/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('devops', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddGroupMemberRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  accessLevel?: int32(name='accessLevel', description='This parameter is required.', example='30'),
  aliyunPks?: string(name='aliyunPks', description='This parameter is required.', example='18745637472884'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model AddGroupMemberResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: [ 
    {
      accessLevel?: int32(name='accessLevel', example='30'),
      avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
      email?: string(name='email', example='username@example.com'),
      id?: long(name='id', example='123456'),
      name?: string(name='name', example='codeup'),
      sourceId?: long(name='sourceId', example='223241'),
      state?: string(name='state', example='active'),
      username?: string(name='username', example='test-codeup'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
}

model AddGroupMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddGroupMemberResponseBody(name='body'),
}

/**
 * @summary 添加组成员
 *
 * @param request AddGroupMemberRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddGroupMemberResponse
 */
async function addGroupMemberWithOptions(groupId: string, request: AddGroupMemberRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddGroupMemberResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.accessLevel)) {
    body['accessLevel'] = request.accessLevel;
  }
  if (!Util.isUnset(request.aliyunPks)) {
    body['aliyunPks'] = request.aliyunPks;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddGroupMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/groups/${OpenApiUtil.getEncodeParam(groupId)}/members/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 添加组成员
 *
 * @param request AddGroupMemberRequest
 * @return AddGroupMemberResponse
 */
async function addGroupMember(groupId: string, request: AddGroupMemberRequest): AddGroupMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return addGroupMemberWithOptions(groupId, request, headers, runtime);
}

model AddPipelineRelationsRequest {
  relObjectIds?: string(name='relObjectIds', description='This parameter is required.', example='11,22'),
  relObjectType?: string(name='relObjectType', description='This parameter is required.', example='VARIABLE_GROUP'),
}

model AddPipelineRelationsResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model AddPipelineRelationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddPipelineRelationsResponseBody(name='body'),
}

/**
 * @summary 添加流水线关联
 *
 * @param request AddPipelineRelationsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddPipelineRelationsResponse
 */
async function addPipelineRelationsWithOptions(organizationId: string, pipelineId: string, request: AddPipelineRelationsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddPipelineRelationsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.relObjectIds)) {
    query['relObjectIds'] = request.relObjectIds;
  }
  if (!Util.isUnset(request.relObjectType)) {
    query['relObjectType'] = request.relObjectType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddPipelineRelations',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/${OpenApiUtil.getEncodeParam(pipelineId)}/pipelineRelations`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 添加流水线关联
 *
 * @param request AddPipelineRelationsRequest
 * @return AddPipelineRelationsResponse
 */
async function addPipelineRelations(organizationId: string, pipelineId: string, request: AddPipelineRelationsRequest): AddPipelineRelationsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return addPipelineRelationsWithOptions(organizationId, pipelineId, request, headers, runtime);
}

model AddRepositoryMemberRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  accessLevel?: int32(name='accessLevel', description='This parameter is required.', example='30'),
  aliyunPks?: string(name='aliyunPks', description='This parameter is required.', example='18745637472884'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model AddRepositoryMemberResponseBody = {
  errorCode?: string(name='errorCode', example='Invalid.IdNotFound'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='4D6AF7CC-B43B-5454-86AB-023D25E44868'),
  result?: [ 
    {
      accessLevel?: int32(name='accessLevel', example='40'),
      avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
      email?: string(name='email', example='username@example.com'),
      id?: long(name='id', example='123456'),
      state?: string(name='state', example='active'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
}

model AddRepositoryMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddRepositoryMemberResponseBody(name='body'),
}

/**
 * @summary 添加代码库成员
 *
 * @param request AddRepositoryMemberRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddRepositoryMemberResponse
 */
async function addRepositoryMemberWithOptions(repositoryId: string, request: AddRepositoryMemberRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddRepositoryMemberResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.accessLevel)) {
    body['accessLevel'] = request.accessLevel;
  }
  if (!Util.isUnset(request.aliyunPks)) {
    body['aliyunPks'] = request.aliyunPks;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddRepositoryMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/members`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 添加代码库成员
 *
 * @param request AddRepositoryMemberRequest
 * @return AddRepositoryMemberResponse
 */
async function addRepositoryMember(repositoryId: string, request: AddRepositoryMemberRequest): AddRepositoryMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return addRepositoryMemberWithOptions(repositoryId, request, headers, runtime);
}

model AddWebhookRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  description?: string(name='description'),
  enableSslVerification?: boolean(name='enableSslVerification', example='false'),
  mergeRequestsEvents?: boolean(name='mergeRequestsEvents', example='true'),
  noteEvents?: boolean(name='noteEvents', example='false'),
  pushEvents?: boolean(name='pushEvents', example='true'),
  secretToken?: string(name='secretToken', example='xxxx'),
  tagPushEvents?: boolean(name='tagPushEvents', example='false'),
  url?: string(name='url', description='This parameter is required.', example='https://xxxxx'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model AddWebhookResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_NOT_FOUND_ERROR'),
  errorMessage?: string(name='errorMessage', example='“”'),
  requestId?: string(name='requestId', example='6177543A-8D54-5736-A93B-E0195A1512CB'),
  result?: {
    createdAt?: string(name='createdAt', example='2022-03-12 12:00:00'),
    description?: string(name='description'),
    enableSslVerification?: boolean(name='enableSslVerification', example='false'),
    id?: long(name='id', example='30815'),
    lastTestResult?: string(name='lastTestResult', example='ok'),
    mergeRequestsEvents?: boolean(name='mergeRequestsEvents', example='true'),
    noteEvents?: boolean(name='noteEvents', example='false'),
    pushEvents?: boolean(name='pushEvents', example='true'),
    repositoryId?: long(name='repositoryId', example='2835387'),
    secretToken?: string(name='secretToken', example='xxxx'),
    tagPushEvents?: boolean(name='tagPushEvents', example='true'),
    url?: string(name='url', example='https://xxxxx'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model AddWebhookResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddWebhookResponseBody(name='body'),
}

/**
 * @summary 添加代码库Webhook
 *
 * @param request AddWebhookRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddWebhookResponse
 */
async function addWebhookWithOptions(repositoryId: string, request: AddWebhookRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddWebhookResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.enableSslVerification)) {
    body['enableSslVerification'] = request.enableSslVerification;
  }
  if (!Util.isUnset(request.mergeRequestsEvents)) {
    body['mergeRequestsEvents'] = request.mergeRequestsEvents;
  }
  if (!Util.isUnset(request.noteEvents)) {
    body['noteEvents'] = request.noteEvents;
  }
  if (!Util.isUnset(request.pushEvents)) {
    body['pushEvents'] = request.pushEvents;
  }
  if (!Util.isUnset(request.secretToken)) {
    body['secretToken'] = request.secretToken;
  }
  if (!Util.isUnset(request.tagPushEvents)) {
    body['tagPushEvents'] = request.tagPushEvents;
  }
  if (!Util.isUnset(request.url)) {
    body['url'] = request.url;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddWebhook',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/webhooks/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 添加代码库Webhook
 *
 * @param request AddWebhookRequest
 * @return AddWebhookResponse
 */
async function addWebhook(repositoryId: string, request: AddWebhookRequest): AddWebhookResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return addWebhookWithOptions(repositoryId, request, headers, runtime);
}

model CancelExecutionReleaseStageRequest {
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c19****'),
}

model CancelExecutionReleaseStageResponseBody = {
  success?: boolean(name='success', example='true'),
}

model CancelExecutionReleaseStageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelExecutionReleaseStageResponseBody(name='body'),
}

/**
 * @summary 取消执行研发阶段流水线
 *
 * @param request CancelExecutionReleaseStageRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelExecutionReleaseStageResponse
 */
async function cancelExecutionReleaseStageWithOptions(appName: string, releaseWorkflowSn: string, releaseStageSn: string, executionNumber: string, request: CancelExecutionReleaseStageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CancelExecutionReleaseStageResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelExecutionReleaseStage',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/releaseWorkflows/${OpenApiUtil.getEncodeParam(releaseWorkflowSn)}/releaseStages/${OpenApiUtil.getEncodeParam(releaseStageSn)}/executions/${OpenApiUtil.getEncodeParam(executionNumber)}%3Acancel`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 取消执行研发阶段流水线
 *
 * @param request CancelExecutionReleaseStageRequest
 * @return CancelExecutionReleaseStageResponse
 */
async function cancelExecutionReleaseStage(appName: string, releaseWorkflowSn: string, releaseStageSn: string, executionNumber: string, request: CancelExecutionReleaseStageRequest): CancelExecutionReleaseStageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return cancelExecutionReleaseStageWithOptions(appName, releaseWorkflowSn, releaseStageSn, executionNumber, request, headers, runtime);
}

model CloseMergeRequestRequest {
  accessToken?: string(name='accessToken', example='0cf2c8458ac44d9481aab2dd6ec10596v3'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
}

model CloseMergeRequestResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='InvalidParam.NoPermission'),
  requestId?: string(name='requestId', example='HC93CE1A-8D7A-13A9-8306-7465DE2E5C0F'),
  result?: {
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CloseMergeRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CloseMergeRequestResponseBody(name='body'),
}

/**
 * @summary 关闭代码评审
 *
 * @param request CloseMergeRequestRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CloseMergeRequestResponse
 */
async function closeMergeRequestWithOptions(repositoryId: string, localId: string, request: CloseMergeRequestRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CloseMergeRequestResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CloseMergeRequest',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/${OpenApiUtil.getEncodeParam(repositoryId)}/merge_requests/${OpenApiUtil.getEncodeParam(localId)}/close`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 关闭代码评审
 *
 * @param request CloseMergeRequestRequest
 * @return CloseMergeRequestResponse
 */
async function closeMergeRequest(repositoryId: string, localId: string, request: CloseMergeRequestRequest): CloseMergeRequestResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return closeMergeRequestWithOptions(repositoryId, localId, request, headers, runtime);
}

model CreateAppMembersRequest {
  playerList?: [ 
    {
      id?: string(name='id', example='1332695887xxxxxx'),
      type?: string(name='type', example='User'),
    }
  ](name='playerList'),
  roleNames?: [ string ](name='roleNames'),
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199fcd'),
}

model CreateAppMembersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: string(name='body'),
}

/**
 * @summary 添加应用成员
 *
 * @param request CreateAppMembersRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAppMembersResponse
 */
async function createAppMembersWithOptions(appName: string, request: CreateAppMembersRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateAppMembersResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.playerList)) {
    body['playerList'] = request.playerList;
  }
  if (!Util.isUnset(request.roleNames)) {
    body['roleNames'] = request.roleNames;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppMembers',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/members`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'string',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 添加应用成员
 *
 * @param request CreateAppMembersRequest
 * @return CreateAppMembersResponse
 */
async function createAppMembers(appName: string, request: CreateAppMembersRequest): CreateAppMembersResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createAppMembersWithOptions(appName, request, headers, runtime);
}

model CreateBranchRequest {
  accessToken?: string(name='accessToken', example='0cf2c8458ac44d9481aab2dd6ec10596v3'),
  branchName?: string(name='branchName', description='This parameter is required.', example='createBranch'),
  ref?: string(name='ref', description='This parameter is required.', example='master'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model CreateBranchResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: {
    commit?: {
      authorEmail?: string(name='authorEmail', example='username@example.com'),
      authorName?: string(name='authorName'),
      authoredDate?: string(name='authoredDate', example='2022-03-18 09:00:00'),
      committedDate?: string(name='committedDate', example='2022-03-18 10:00:00'),
      committerEmail?: string(name='committerEmail', example='username@example.com'),
      committerName?: string(name='committerName'),
      createdAt?: string(name='createdAt', example='2022-03-18 10:00:00'),
      id?: string(name='id', example='ff4fb5ac6d1f44f452654336d2dba468ae6c8d04'),
      message?: string(name='message', example='create branch'),
      parentIds?: [ string ](name='parentIds'),
      shortId?: string(name='shortId', example='ff4fb5ac'),
      title?: string(name='title'),
    }(name='commit'),
    name?: string(name='name', example='createBranch'),
    protected?: boolean(name='protected', example='false'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreateBranchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBranchResponseBody(name='body'),
}

/**
 * @summary 创建分支
 *
 * @param request CreateBranchRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBranchResponse
 */
async function createBranchWithOptions(repositoryId: string, request: CreateBranchRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateBranchResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.branchName)) {
    body['branchName'] = request.branchName;
  }
  if (!Util.isUnset(request.ref)) {
    body['ref'] = request.ref;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateBranch',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/branches`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建分支
 *
 * @param request CreateBranchRequest
 * @return CreateBranchResponse
 */
async function createBranch(repositoryId: string, request: CreateBranchRequest): CreateBranchResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createBranchWithOptions(repositoryId, request, headers, runtime);
}

model CreateChangeRequestRequest {
  appCodeRepoSn?: string(name='appCodeRepoSn', description='This parameter is required.', example='sn123'),
  autoDeleteBranchWhenEnd?: boolean(name='autoDeleteBranchWhenEnd', example='false'),
  branchName?: string(name='branchName', description='This parameter is required.', example='hotfix/20240524'),
  createBranch?: boolean(name='createBranch', example='false'),
  ownerAccountId?: string(name='ownerAccountId', example='1332695887xxxxxx'),
  ownerId?: string(name='ownerId', description='This parameter is required.'),
  title?: string(name='title', description='This parameter is required.'),
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199fcd'),
}

model CreateChangeRequestResponseBody = {
  appCodeRepoSn?: string(name='appCodeRepoSn', example='sn123'),
  appName?: string(name='appName', example='app-name'),
  autoDeleteBranchWhenEnd?: boolean(name='autoDeleteBranchWhenEnd', example='false'),
  branch?: string(name='branch', example='hotfix/20240524'),
  creatorAccountId?: string(name='creatorAccountId', example='create-account-123'),
  creatorId?: string(name='creatorId', example='create-id-123'),
  gmtCreate?: string(name='gmtCreate', example='2024-01-01 00:00:00'),
  gmtModified?: string(name='gmtModified', example='2024-01-01 00:00:00'),
  name?: string(name='name'),
  originBranch?: string(name='originBranch', example='master'),
  originBranchRevisionSha?: string(name='originBranchRevisionSha', example='revision-123'),
  ownerAccountId?: string(name='ownerAccountId', example='account-id-123'),
  ownerId?: string(name='ownerId', example='owner-id-123'),
  sn?: string(name='sn', example='ce51b31b996246ecaf874736838360b2'),
  state?: string(name='state', example='DEVELOPING'),
  type?: string(name='type', example='APP'),
}

model CreateChangeRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateChangeRequestResponseBody(name='body'),
}

/**
 * @summary 创建变更
 *
 * @param request CreateChangeRequestRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateChangeRequestResponse
 */
async function createChangeRequestWithOptions(appName: string, request: CreateChangeRequestRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateChangeRequestResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.appCodeRepoSn)) {
    body['appCodeRepoSn'] = request.appCodeRepoSn;
  }
  if (!Util.isUnset(request.autoDeleteBranchWhenEnd)) {
    body['autoDeleteBranchWhenEnd'] = request.autoDeleteBranchWhenEnd;
  }
  if (!Util.isUnset(request.branchName)) {
    body['branchName'] = request.branchName;
  }
  if (!Util.isUnset(request.createBranch)) {
    body['createBranch'] = request.createBranch;
  }
  if (!Util.isUnset(request.ownerAccountId)) {
    body['ownerAccountId'] = request.ownerAccountId;
  }
  if (!Util.isUnset(request.ownerId)) {
    body['ownerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.title)) {
    body['title'] = request.title;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateChangeRequest',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/changeRequests`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建变更
 *
 * @param request CreateChangeRequestRequest
 * @return CreateChangeRequestResponse
 */
async function createChangeRequest(appName: string, request: CreateChangeRequestRequest): CreateChangeRequestResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createChangeRequestWithOptions(appName, request, headers, runtime);
}

model CreateCheckRunRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  annotations?: [ 
    {
      annotationLevel?: string(name='annotationLevel', description='This parameter is required.', example='notice'),
      endColumn?: long(name='endColumn', example='5'),
      endLine?: long(name='endLine', description='This parameter is required.', example='2'),
      message?: string(name='message', description='This parameter is required.'),
      path?: string(name='path', description='This parameter is required.', example='demo/test.txt'),
      rawDetails?: string(name='rawDetails'),
      startColumn?: long(name='startColumn', example='3'),
      startLine?: long(name='startLine', description='This parameter is required.', example='1'),
      title?: string(name='title'),
    }
  ](name='annotations'),
  completedAt?: string(name='completedAt', example='2023-03-15T08:00:00Z'),
  conclusion?: string(name='conclusion', example='success'),
  detailsUrl?: string(name='detailsUrl', example='xxx'),
  externalId?: string(name='externalId', example='42'),
  headSha?: string(name='headSha', description='This parameter is required.', example='40f4ccfe019cdd4a62d4acb0c57130106fc7e1be'),
  name?: string(name='name', description='This parameter is required.', example='my-check-ci'),
  output?: {
    images?: [ 
      {
        alt?: string(name='alt', description='This parameter is required.', example='test-image-alt'),
        caption?: string(name='caption', example='test'),
        imageUrl?: string(name='imageUrl', description='This parameter is required.', example='xxx'),
      }
    ](name='images'),
    summary?: string(name='summary', description='This parameter is required.'),
    text?: string(name='text'),
    title?: string(name='title', description='This parameter is required.', example='Mighty Readme report'),
  }(name='output'),
  startedAt?: string(name='startedAt', example='2023-03-15T08:00:00Z'),
  status?: string(name='status', example='completed'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
}

model CreateCheckRunResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    annotations?: [ 
      {
        annotationLevel?: string(name='annotationLevel', example='notice'),
        endColumn?: long(name='endColumn', example='5'),
        endLine?: long(name='endLine', example='2'),
        id?: long(name='id', example='2'),
        message?: string(name='message'),
        path?: string(name='path', example='demo/test.txt'),
        rawDetails?: string(name='rawDetails'),
        startColumn?: long(name='startColumn', example='3'),
        startLine?: long(name='startLine', example='1'),
        title?: string(name='title'),
      }
    ](name='annotations'),
    checkSuite?: {
      id?: long(name='id', example='1'),
    }(name='checkSuite'),
    completedAt?: string(name='completedAt', example='2023-03-15T08:00:00Z'),
    conclusion?: string(name='conclusion', example='success'),
    createdAt?: string(name='createdAt', example='2022-01-14T21:08:26+08:00'),
    detailsUrl?: string(name='detailsUrl', example='xxx'),
    externalId?: string(name='externalId', example='42'),
    headSha?: string(name='headSha', example='40f4ccfe019cdd4a62d4acb0c57130106fc7e1be'),
    id?: long(name='id', example='524836'),
    name?: string(name='name', example='my-check-ci'),
    output?: {
      images?: [ 
        {
          alt?: string(name='alt', example='test-image-alt'),
          caption?: string(name='caption', example='test'),
          imageUrl?: string(name='imageUrl', example='xxx'),
        }
      ](name='images'),
      summary?: string(name='summary'),
      text?: string(name='text'),
      title?: string(name='title', example='Mighty Readme report'),
    }(name='output'),
    startedAt?: string(name='startedAt', example='2023-03-15T08:00:00Z'),
    status?: string(name='status', example='completed'),
    updatedAt?: string(name='updatedAt', example='2022-01-14T21:08:26+08:00'),
    writer?: {
      id?: string(name='id', example='xxx'),
      logoUrl?: string(name='logoUrl', example='xxx'),
      name?: string(name='name', example='test-codeup'),
      slug?: string(name='slug', example='test-codeup'),
      type?: string(name='type', example='User'),
    }(name='writer'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreateCheckRunResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCheckRunResponseBody(name='body'),
}

/**
 * @summary 添加检查运行记录
 *
 * @param request CreateCheckRunRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCheckRunResponse
 */
async function createCheckRunWithOptions(request: CreateCheckRunRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateCheckRunResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.annotations)) {
    body['annotations'] = request.annotations;
  }
  if (!Util.isUnset(request.completedAt)) {
    body['completedAt'] = request.completedAt;
  }
  if (!Util.isUnset(request.conclusion)) {
    body['conclusion'] = request.conclusion;
  }
  if (!Util.isUnset(request.detailsUrl)) {
    body['detailsUrl'] = request.detailsUrl;
  }
  if (!Util.isUnset(request.externalId)) {
    body['externalId'] = request.externalId;
  }
  if (!Util.isUnset(request.headSha)) {
    body['headSha'] = request.headSha;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.output)) {
    body['output'] = request.output;
  }
  if (!Util.isUnset(request.startedAt)) {
    body['startedAt'] = request.startedAt;
  }
  if (!Util.isUnset(request.status)) {
    body['status'] = request.status;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateCheckRun',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/check_runs/create_check_run`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 添加检查运行记录
 *
 * @param request CreateCheckRunRequest
 * @return CreateCheckRunResponse
 */
async function createCheckRun(request: CreateCheckRunRequest): CreateCheckRunResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createCheckRunWithOptions(request, headers, runtime);
}

model CreateCommentRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  commentType?: string(name='commentType', description='This parameter is required.', example='GLOBAL_COMMENT'),
  content?: string(name='content', description='This parameter is required.'),
  draft?: boolean(name='draft', example='false'),
  filePath?: string(name='filePath', example='/src/main/test.java'),
  fromPachSetBizId?: string(name='fromPachSetBizId'),
  lineNumber?: int32(name='lineNumber', example='1'),
  parentCommentBizId?: string(name='parentCommentBizId', example='2666ac1ac53841b0ba1b042e383279cc'),
  patchSetBizId?: string(name='patchSetBizId', example='b7d8386be17c4ca68a07140db4836257'),
  resolved?: boolean(name='resolved', example='false'),
  toPatchSetBizId?: string(name='toPatchSetBizId'),
  localId?: long(name='localId', description='This parameter is required.', example='1'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
}

model CreateCommentResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    author?: {
      aliyunPk?: string(name='aliyunPk', example='284692704493684695'),
      avatarUrl?: string(name='avatarUrl'),
      email?: string(name='email', example='username@example.com'),
      id?: long(name='id', example='19927'),
      name?: string(name='name', example='test-codeup'),
      state?: string(name='state', example='active'),
      username?: string(name='username', example='test-codeup'),
    }(name='author'),
    commentBizId?: string(name='commentBizId', example='5c399e3685e542a28db16d93e9f82abb'),
    commentTime?: string(name='commentTime', example='2022-03-18 14:24:54'),
    commentType?: string(name='commentType', example='GLOBAL_COMMENT'),
    content?: string(name='content', example='xxxx'),
    deleted?: boolean(name='deleted', example='false'),
    filePath?: string(name='filePath', example='src/main/update.txt'),
    lastEditTime?: string(name='lastEditTime', example='2022-03-18 14:24:54'),
    lineNumber?: string(name='lineNumber', example='3'),
    parentCommentBizId?: string(name='parentCommentBizId', example='4c5dcec6a8dc41e69c369737dadc1841'),
    relatedPatchSet?: {
      commitId?: string(name='commitId', example='1a072f5367c21f9de3464b8c0ee8546e47764d2d'),
      createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
      patchSetBizId?: string(name='patchSetBizId', example='513fcfd81a9142d2bb0db4f72c0aa15b'),
      patchSetName?: string(name='patchSetName'),
      patchSetNo?: string(name='patchSetNo', example='1'),
      relatedMergeItemType?: string(name='relatedMergeItemType', example='MERGE_SOURCE'),
      shortId?: string(name='shortId', example='1a072f53'),
    }(name='relatedPatchSet'),
    resolved?: boolean(name='resolved', example='false'),
    rootCommentBizId?: string(name='rootCommentBizId', example='dcf2b23cebfc418f98dbd35e423d9fd3'),
    state?: string(name='state', example='OPENED'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreateCommentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCommentResponseBody(name='body'),
}

/**
 * @summary 创建评论
 *
 * @param request CreateCommentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCommentResponse
 */
async function createCommentWithOptions(request: CreateCommentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateCommentResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.localId)) {
    query['localId'] = request.localId;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.commentType)) {
    body['commentType'] = request.commentType;
  }
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.draft)) {
    body['draft'] = request.draft;
  }
  if (!Util.isUnset(request.filePath)) {
    body['filePath'] = request.filePath;
  }
  if (!Util.isUnset(request.fromPachSetBizId)) {
    body['fromPachSetBizId'] = request.fromPachSetBizId;
  }
  if (!Util.isUnset(request.lineNumber)) {
    body['lineNumber'] = request.lineNumber;
  }
  if (!Util.isUnset(request.parentCommentBizId)) {
    body['parentCommentBizId'] = request.parentCommentBizId;
  }
  if (!Util.isUnset(request.patchSetBizId)) {
    body['patchSetBizId'] = request.patchSetBizId;
  }
  if (!Util.isUnset(request.resolved)) {
    body['resolved'] = request.resolved;
  }
  if (!Util.isUnset(request.toPatchSetBizId)) {
    body['toPatchSetBizId'] = request.toPatchSetBizId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateComment',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/code_reviews/comments/create_comment`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建评论
 *
 * @param request CreateCommentRequest
 * @return CreateCommentResponse
 */
async function createComment(request: CreateCommentRequest): CreateCommentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createCommentWithOptions(request, headers, runtime);
}

model CreateCommitStatusRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  context?: string(name='context', example='default'),
  description?: string(name='description'),
  state?: string(name='state', description='This parameter is required.', example='success'),
  targetUrl?: string(name='targetUrl', example='xxx'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.', example='2080972'),
  sha?: string(name='sha', description='This parameter is required.', example='e0c1a1299a2656bfc155650bbd2df5e628fa1f4c'),
}

model CreateCommitStatusResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='020F71F3-F063-5B8B-8978-2B01833216BB'),
  result?: {
    context?: string(name='context', example='default'),
    creator?: {
      aliyunPk?: long(name='aliyunPk', example='204485087002425236'),
      avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
      login?: string(name='login', example='codeup'),
      type?: string(name='type', example='User'),
    }(name='creator'),
    description?: string(name='description'),
    id?: long(name='id', example='30815'),
    sha?: string(name='sha', example='c0ca103441b9fa7f369be8d24a6f20db44dfddf7'),
    state?: string(name='state', example='success'),
    targetUrl?: string(name='targetUrl', example='xxx'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreateCommitStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCommitStatusResponseBody(name='body'),
}

/**
 * @summary 创建提交状态记录
 *
 * @param request CreateCommitStatusRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCommitStatusResponse
 */
async function createCommitStatusWithOptions(request: CreateCommitStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateCommitStatusResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }
  if (!Util.isUnset(request.sha)) {
    query['sha'] = request.sha;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.context)) {
    body['context'] = request.context;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.state)) {
    body['state'] = request.state;
  }
  if (!Util.isUnset(request.targetUrl)) {
    body['targetUrl'] = request.targetUrl;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateCommitStatus',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/repository/commit_statuses/create_commit_status`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建提交状态记录
 *
 * @param request CreateCommitStatusRequest
 * @return CreateCommitStatusResponse
 */
async function createCommitStatus(request: CreateCommitStatusRequest): CreateCommitStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createCommitStatusWithOptions(request, headers, runtime);
}

model CreateCommitWithMultipleFilesRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  actions?: [ 
    {
      action?: string(name='action', example='create'),
      content?: string(name='content', example='xxx'),
      filePath?: string(name='filePath', example='src/test.java'),
      previousPath?: string(name='previousPath', example='src/main/test.java'),
    }
  ](name='actions', description='This parameter is required.'),
  branch?: string(name='branch', description='This parameter is required.', example='master'),
  commitMessage?: string(name='commitMessage', example='auto'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
}

model CreateCommitWithMultipleFilesResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', example='A7586FEB-E48D-5579-983F-74981FBFF627'),
  result?: {
    author?: {
      aliyunPk?: string(name='aliyunPk', example='284692704493684695'),
      avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c4ef67f1bea827c4/w/100/h/100'),
      email?: string(name='email', example='username@example.com'),
      id?: long(name='id', example='19927'),
      name?: string(name='name', example='test-codeup'),
      state?: string(name='state', example='active'),
      username?: string(name='username', example='test-codeup'),
      websiteUrl?: string(name='websiteUrl', example='""'),
    }(name='author'),
    authorEmail?: string(name='authorEmail', example='username@example.com'),
    authorName?: string(name='authorName', example='test-codeup'),
    authoredDate?: string(name='authoredDate', example='2022-03-18 15:00:00'),
    committedDate?: string(name='committedDate', example='2022-03-18 16:00:00'),
    committer?: {
      aliyunPk?: string(name='aliyunPk', example='235671547828975455'),
      avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
      email?: string(name='email', example='username@example.com'),
      id?: long(name='id', example='24661'),
      name?: string(name='name', example='committer-codeup'),
      state?: string(name='state', example='active'),
      username?: string(name='username', example='committer-codeup'),
      websiteUrl?: string(name='websiteUrl', example='""'),
    }(name='committer'),
    committerEmail?: string(name='committerEmail', example='username@example.com'),
    committerName?: string(name='committerName', example='committer-codeup'),
    createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
    id?: string(name='id', example='de02b625ba8488f92eb204bcb3773a40c1b4ddac'),
    message?: string(name='message'),
    parentIds?: [ string ](name='parentIds'),
    shortId?: string(name='shortId', example='de02b625'),
    title?: string(name='title'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreateCommitWithMultipleFilesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCommitWithMultipleFilesResponseBody(name='body'),
}

/**
 * @summary 单提交变更多个文件
 *
 * @param request CreateCommitWithMultipleFilesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCommitWithMultipleFilesResponse
 */
async function createCommitWithMultipleFilesWithOptions(request: CreateCommitWithMultipleFilesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateCommitWithMultipleFilesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.actions)) {
    body['actions'] = request.actions;
  }
  if (!Util.isUnset(request.branch)) {
    body['branch'] = request.branch;
  }
  if (!Util.isUnset(request.commitMessage)) {
    body['commitMessage'] = request.commitMessage;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateCommitWithMultipleFiles',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/repository/commits/files`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 单提交变更多个文件
 *
 * @param request CreateCommitWithMultipleFilesRequest
 * @return CreateCommitWithMultipleFilesResponse
 */
async function createCommitWithMultipleFiles(request: CreateCommitWithMultipleFilesRequest): CreateCommitWithMultipleFilesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createCommitWithMultipleFilesWithOptions(request, headers, runtime);
}

model CreateDeployKeyRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  key?: string(name='key', description='This parameter is required.', example='""'),
  title?: string(name='title', description='This parameter is required.'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model CreateDeployKeyResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
    fingerprint?: string(name='fingerprint', example='xx:xx:xx:xx'),
    id?: long(name='id', example='502385'),
    key?: string(name='key', example='""'),
    title?: string(name='title'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreateDeployKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDeployKeyResponseBody(name='body'),
}

/**
 * @summary 创建部署密钥
 *
 * @param request CreateDeployKeyRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDeployKeyResponse
 */
async function createDeployKeyWithOptions(repositoryId: string, request: CreateDeployKeyRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateDeployKeyResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.key)) {
    body['key'] = request.key;
  }
  if (!Util.isUnset(request.title)) {
    body['title'] = request.title;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDeployKey',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/keys/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建部署密钥
 *
 * @param request CreateDeployKeyRequest
 * @return CreateDeployKeyResponse
 */
async function createDeployKey(repositoryId: string, request: CreateDeployKeyRequest): CreateDeployKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createDeployKeyWithOptions(repositoryId, request, headers, runtime);
}

model CreateFileRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  branchName?: string(name='branchName', description='This parameter is required.', example='master'),
  commitMessage?: string(name='commitMessage', description='This parameter is required.'),
  content?: string(name='content', description='This parameter is required.'),
  encoding?: string(name='encoding', example='text'),
  filePath?: string(name='filePath', description='This parameter is required.', example='/src/main/test.java'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model CreateFileResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='F8053E32-9623-511F-8B46-F0E5FD206524'),
  result?: {
    branchName?: string(name='branchName', example='master'),
    filePath?: string(name='filePath', example='/src/main/test.java'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreateFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFileResponseBody(name='body'),
}

/**
 * @summary 创建文件
 *
 * @param request CreateFileRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateFileResponse
 */
async function createFileWithOptions(repositoryId: string, request: CreateFileRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateFileResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.branchName)) {
    body['branchName'] = request.branchName;
  }
  if (!Util.isUnset(request.commitMessage)) {
    body['commitMessage'] = request.commitMessage;
  }
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.encoding)) {
    body['encoding'] = request.encoding;
  }
  if (!Util.isUnset(request.filePath)) {
    body['filePath'] = request.filePath;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateFile',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/files`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建文件
 *
 * @param request CreateFileRequest
 * @return CreateFileResponse
 */
async function createFile(repositoryId: string, request: CreateFileRequest): CreateFileResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createFileWithOptions(repositoryId, request, headers, runtime);
}

model CreateFlowTagRequest {
  color?: string(name='color', description='This parameter is required.', example='#1F9AEF'),
  flowTagGroupId?: long(name='flowTagGroupId', description='This parameter is required.', example='111'),
  name?: string(name='name', description='This parameter is required.'),
}

model CreateFlowTagResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  id?: long(name='id', example='111'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model CreateFlowTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFlowTagResponseBody(name='body'),
}

/**
 * @summary 创建标签
 *
 * @param request CreateFlowTagRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateFlowTagResponse
 */
async function createFlowTagWithOptions(organizationId: string, request: CreateFlowTagRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateFlowTagResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.color)) {
    query['color'] = request.color;
  }
  if (!Util.isUnset(request.flowTagGroupId)) {
    query['flowTagGroupId'] = request.flowTagGroupId;
  }
  if (!Util.isUnset(request.name)) {
    query['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateFlowTag',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/flow/tags`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建标签
 *
 * @param request CreateFlowTagRequest
 * @return CreateFlowTagResponse
 */
async function createFlowTag(organizationId: string, request: CreateFlowTagRequest): CreateFlowTagResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createFlowTagWithOptions(organizationId, request, headers, runtime);
}

model CreateFlowTagGroupRequest {
  name?: string(name='name', description='This parameter is required.'),
}

model CreateFlowTagGroupResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  id?: long(name='id', example='1223'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model CreateFlowTagGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFlowTagGroupResponseBody(name='body'),
}

/**
 * @summary 创建标签分类
 *
 * @param request CreateFlowTagGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateFlowTagGroupResponse
 */
async function createFlowTagGroupWithOptions(organizationId: string, request: CreateFlowTagGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateFlowTagGroupResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    query['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateFlowTagGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/flow/tagGroups`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建标签分类
 *
 * @param request CreateFlowTagGroupRequest
 * @return CreateFlowTagGroupResponse
 */
async function createFlowTagGroup(organizationId: string, request: CreateFlowTagGroupRequest): CreateFlowTagGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createFlowTagGroupWithOptions(organizationId, request, headers, runtime);
}

model CreateHostGroupRequest {
  aliyunRegion?: string(name='aliyunRegion', example='cn-beijing'),
  ecsLabelKey?: string(name='ecsLabelKey', example='ecs'),
  ecsLabelValue?: string(name='ecsLabelValue', example='ecs'),
  ecsType?: string(name='ecsType', example='ECS_ALIYUN'),
  envId?: string(name='envId', example='0'),
  machineInfos?: string(name='machineInfos', example='[{"aliyunRegionId":"cn-beijing","machineSn":"i-sssssss","instanceName":"ceshi","ip":"120.0.0.0"}]'),
  name?: string(name='name', description='This parameter is required.'),
  serviceConnectionId?: long(name='serviceConnectionId', description='This parameter is required.', example='123'),
  tagIds?: string(name='tagIds', example='12,234'),
  type?: string(name='type', description='This parameter is required.', example='ECS'),
}

model CreateHostGroupResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  hostGroupId?: long(name='hostGroupId', example='123'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model CreateHostGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateHostGroupResponseBody(name='body'),
}

/**
 * @summary 创建主机组
 *
 * @param request CreateHostGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateHostGroupResponse
 */
async function createHostGroupWithOptions(organizationId: string, request: CreateHostGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateHostGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aliyunRegion)) {
    body['aliyunRegion'] = request.aliyunRegion;
  }
  if (!Util.isUnset(request.ecsLabelKey)) {
    body['ecsLabelKey'] = request.ecsLabelKey;
  }
  if (!Util.isUnset(request.ecsLabelValue)) {
    body['ecsLabelValue'] = request.ecsLabelValue;
  }
  if (!Util.isUnset(request.ecsType)) {
    body['ecsType'] = request.ecsType;
  }
  if (!Util.isUnset(request.envId)) {
    body['envId'] = request.envId;
  }
  if (!Util.isUnset(request.machineInfos)) {
    body['machineInfos'] = request.machineInfos;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.serviceConnectionId)) {
    body['serviceConnectionId'] = request.serviceConnectionId;
  }
  if (!Util.isUnset(request.tagIds)) {
    body['tagIds'] = request.tagIds;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateHostGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/hostGroups`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建主机组
 *
 * @param request CreateHostGroupRequest
 * @return CreateHostGroupResponse
 */
async function createHostGroup(organizationId: string, request: CreateHostGroupRequest): CreateHostGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createHostGroupWithOptions(organizationId, request, headers, runtime);
}

model CreateMergeRequestRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  createFrom?: string(name='createFrom', description='This parameter is required.', example='WEB'),
  description?: string(name='description'),
  reviewerIds?: [ string ](name='reviewerIds'),
  sourceBranch?: string(name='sourceBranch', description='This parameter is required.', example='sourceBranch'),
  sourceProjectId?: long(name='sourceProjectId', description='This parameter is required.', example='2369234'),
  targetBranch?: string(name='targetBranch', description='This parameter is required.', example='targetBranch'),
  targetProjectId?: long(name='targetProjectId', description='This parameter is required.', example='2369234'),
  title?: string(name='title', description='This parameter is required.'),
  workItemIds?: string(name='workItemIds', example='722200214032b6b31e6f1434ab'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='6270e731cfea268afc21ccac'),
}

model CreateMergeRequestResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: {
    ahead?: int32(name='ahead', example='2'),
    allRequirementsPass?: boolean(name='allRequirementsPass', example='true'),
    author?: {
      avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
      email?: string(name='email', example='username@example.com'),
      id?: long(name='id', example='19230'),
      name?: string(name='name', example='test-codeup'),
      state?: string(name='state', example='active'),
      username?: string(name='username', example='test-codeup-nickname'),
    }(name='author'),
    behind?: int32(name='behind', example='0'),
    createFrom?: string(name='createFrom', example='WEB'),
    createTime?: string(name='createTime', example='2023-06-02T03:41:22Z'),
    description?: string(name='description'),
    detailUrl?: string(name='detailUrl', example='xxx'),
    localId?: long(name='localId', example='1'),
    mrBizId?: string(name='mrBizId', example='bca90244c4b749e0b109df52ac0eb570'),
    mrType?: string(name='mrType', example='CODE_REVIEW'),
    projectId?: long(name='projectId', example='2369234'),
    reviewers?: [ 
      {
        avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
        email?: string(name='email', example='username@example.com'),
        hasReviewed?: boolean(name='hasReviewed', example='false'),
        id?: long(name='id', example='7905'),
        name?: string(name='name', example='codeup'),
        reviewOpinionStatus?: string(name='reviewOpinionStatus', example='PASS'),
        state?: string(name='state', example='active'),
        username?: string(name='username', example='root-codeup'),
      }
    ](name='reviewers'),
    sourceBranch?: string(name='sourceBranch', example='sourceBranch'),
    sourceProjectId?: long(name='sourceProjectId', example='2369234'),
    status?: string(name='status', example='UNDER_REVIEW'),
    subscribers?: [ 
      {
        avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
        email?: string(name='email', example='username@example.com'),
        id?: long(name='id', example='10092'),
        name?: string(name='name', example='test-codeup'),
        state?: string(name='state', example='active'),
        username?: string(name='username', example='root-test-codeup'),
      }
    ](name='subscribers'),
    supportMergeFastForwardOnly?: boolean(name='supportMergeFastForwardOnly', example='true'),
    targetBranch?: string(name='targetBranch', example='targetBranch'),
    targetProjectId?: long(name='targetProjectId', example='2369234'),
    title?: string(name='title'),
    updateTime?: string(name='updateTime', example='2023-06-02T03:41:22Z'),
    webUrl?: string(name='webUrl', example='https://codeup.aliyun.com/xxx/test/test'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreateMergeRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMergeRequestResponseBody(name='body'),
}

/**
 * @summary 创建代码评审
 *
 * @param request CreateMergeRequestRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMergeRequestResponse
 */
async function createMergeRequestWithOptions(repositoryId: string, request: CreateMergeRequestRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateMergeRequestResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.createFrom)) {
    body['createFrom'] = request.createFrom;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.reviewerIds)) {
    body['reviewerIds'] = request.reviewerIds;
  }
  if (!Util.isUnset(request.sourceBranch)) {
    body['sourceBranch'] = request.sourceBranch;
  }
  if (!Util.isUnset(request.sourceProjectId)) {
    body['sourceProjectId'] = request.sourceProjectId;
  }
  if (!Util.isUnset(request.targetBranch)) {
    body['targetBranch'] = request.targetBranch;
  }
  if (!Util.isUnset(request.targetProjectId)) {
    body['targetProjectId'] = request.targetProjectId;
  }
  if (!Util.isUnset(request.title)) {
    body['title'] = request.title;
  }
  if (!Util.isUnset(request.workItemIds)) {
    body['workItemIds'] = request.workItemIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateMergeRequest',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/${OpenApiUtil.getEncodeParam(repositoryId)}/merge_requests`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建代码评审
 *
 * @param request CreateMergeRequestRequest
 * @return CreateMergeRequestResponse
 */
async function createMergeRequest(repositoryId: string, request: CreateMergeRequestRequest): CreateMergeRequestResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createMergeRequestWithOptions(repositoryId, request, headers, runtime);
}

model CreateOAuthTokenRequest {
  clientId?: string(name='clientId', description='clientId

This parameter is required.', example='dc7e0b3c00a3e58f46'),
  clientSecret?: string(name='clientSecret', description='client_secret

This parameter is required.', example='a433294edea39cae7e7870'),
  code?: string(name='code', example='86df532f74454e189740d100ac97f4b9'),
  grantType?: string(name='grantType', description='This parameter is required.', example='code'),
  login?: string(name='login', example='username'),
  scope?: string(name='scope', description='This parameter is required.', example='read:repo'),
}

model CreateOAuthTokenResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='C2F153F6-BB43-50C4-9F4F-40593203E19A'),
  result?: {
    accessToken?: string(name='accessToken', example='2aeb4cd012af879e54f0d37dfa526f51'),
    id?: string(name='id', description='id', example='30815'),
    scope?: string(name='scope', example='read:repo'),
    tokenType?: string(name='tokenType', example='code'),
  }(name='result'),
  success?: string(name='success', example='true'),
}

model CreateOAuthTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateOAuthTokenResponseBody(name='body'),
}

/**
 * @summary 创建OAuth令牌
 *
 * @param request CreateOAuthTokenRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateOAuthTokenResponse
 */
async function createOAuthTokenWithOptions(request: CreateOAuthTokenRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateOAuthTokenResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientId)) {
    body['clientId'] = request.clientId;
  }
  if (!Util.isUnset(request.clientSecret)) {
    body['clientSecret'] = request.clientSecret;
  }
  if (!Util.isUnset(request.code)) {
    body['code'] = request.code;
  }
  if (!Util.isUnset(request.grantType)) {
    body['grantType'] = request.grantType;
  }
  if (!Util.isUnset(request.login)) {
    body['login'] = request.login;
  }
  if (!Util.isUnset(request.scope)) {
    body['scope'] = request.scope;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateOAuthToken',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/login/oauth/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建OAuth令牌
 *
 * @param request CreateOAuthTokenRequest
 * @return CreateOAuthTokenResponse
 */
async function createOAuthToken(request: CreateOAuthTokenRequest): CreateOAuthTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createOAuthTokenWithOptions(request, headers, runtime);
}

model CreatePipelineRequest {
  content?: string(name='content', description='This parameter is required.'),
  name?: string(name='name', description='This parameter is required.'),
}

model CreatePipelineResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  pipelinId?: long(name='pipelinId', example='11XXX'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model CreatePipelineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePipelineResponseBody(name='body'),
}

/**
 * @summary 创建流水线。
 *
 * @param request CreatePipelineRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePipelineResponse
 */
async function createPipelineWithOptions(organizationId: string, request: CreatePipelineRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreatePipelineResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreatePipeline',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建流水线。
 *
 * @param request CreatePipelineRequest
 * @return CreatePipelineResponse
 */
async function createPipeline(organizationId: string, request: CreatePipelineRequest): CreatePipelineResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createPipelineWithOptions(organizationId, request, headers, runtime);
}

model CreatePipelineGroupRequest {
  name?: string(name='name', description='This parameter is required.'),
}

model CreatePipelineGroupResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  pipelineGroup?: {
    id?: long(name='id', example='111'),
    name?: string(name='name'),
  }(name='pipelineGroup'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model CreatePipelineGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePipelineGroupResponseBody(name='body'),
}

/**
 * @summary 创建流水线分组
 *
 * @param request CreatePipelineGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePipelineGroupResponse
 */
async function createPipelineGroupWithOptions(organizationId: string, request: CreatePipelineGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreatePipelineGroupResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    query['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreatePipelineGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelineGroups`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建流水线分组
 *
 * @param request CreatePipelineGroupRequest
 * @return CreatePipelineGroupResponse
 */
async function createPipelineGroup(organizationId: string, request: CreatePipelineGroupRequest): CreatePipelineGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createPipelineGroupWithOptions(organizationId, request, headers, runtime);
}

model CreateProjectRequest {
  customCode?: string(name='customCode', description='This parameter is required.', example='ABCD'),
  name?: string(name='name', description='This parameter is required.', example='name'),
  scope?: string(name='scope', description='This parameter is required.', example='public'),
  templateIdentifier?: string(name='templateIdentifier', description='This parameter is required.', example='704eaxxxx5efede61xxx5'),
}

model CreateProjectResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  project?: {
    categoryIdentifier?: string(name='categoryIdentifier', example='Project'),
    creator?: string(name='creator', example='19xx7043xxxxxxx914'),
    customCode?: string(name='customCode', example='OJAY'),
    description?: string(name='description', example='xxx'),
    gmtCreate?: long(name='gmtCreate', example='1623916393000'),
    gmtModified?: long(name='gmtModified', example='1623916393000'),
    icon?: string(name='icon', example='https://xxxxxx.png'),
    identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
    logicalStatus?: string(name='logicalStatus', example='NORMAL'),
    modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
    name?: string(name='name', example='demo示例项目'),
    organizationIdentifier?: string(name='organizationIdentifier', example='5e70xxxxxxcd000xxxxe96'),
    scope?: string(name='scope', example='public'),
    statusIdentifier?: string(name='statusIdentifier', example='8a40xxxxxxxxxxxxx64'),
    statusStageIdentifier?: string(name='statusStageIdentifier', example='1'),
    typeIdentifier?: string(name='typeIdentifier', example='CustomProject'),
  }(name='project'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model CreateProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProjectResponseBody(name='body'),
}

/**
 * @summary 创建项目
 *
 * @param request CreateProjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProjectResponse
 */
async function createProjectWithOptions(organizationId: string, request: CreateProjectRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.customCode)) {
    body['customCode'] = request.customCode;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.scope)) {
    body['scope'] = request.scope;
  }
  if (!Util.isUnset(request.templateIdentifier)) {
    body['templateIdentifier'] = request.templateIdentifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProject',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/projects/createProject`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建项目
 *
 * @param request CreateProjectRequest
 * @return CreateProjectResponse
 */
async function createProject(organizationId: string, request: CreateProjectRequest): CreateProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createProjectWithOptions(organizationId, request, headers, runtime);
}

model CreateProjectLabelRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  color?: string(name='color', description='This parameter is required.', example='#006AD4'),
  description?: string(name='description'),
  name?: string(name='name', description='This parameter is required.'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
}

model CreateProjectLabelResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='A7586FEB-E48D-5579-983F-74981FBFF627'),
  result?: {
    color?: string(name='color', example='#006AD4'),
    description?: string(name='description'),
    id?: string(name='id', example='b5b5738b94954bc6aa5a293316ed1d24'),
    name?: string(name='name'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreateProjectLabelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProjectLabelResponseBody(name='body'),
}

/**
 * @summary 创建代码库Label
 *
 * @param request CreateProjectLabelRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProjectLabelResponse
 */
async function createProjectLabelWithOptions(request: CreateProjectLabelRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateProjectLabelResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.color)) {
    body['color'] = request.color;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProjectLabel',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/labels`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建代码库Label
 *
 * @param request CreateProjectLabelRequest
 * @return CreateProjectLabelResponse
 */
async function createProjectLabel(request: CreateProjectLabelRequest): CreateProjectLabelResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createProjectLabelWithOptions(request, headers, runtime);
}

model CreateProtectdBranchRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  allowMergeRoles?: [ int32 ](name='allowMergeRoles', description='This parameter is required.'),
  allowMergeUserIds?: [ string ](name='allowMergeUserIds'),
  allowPushRoles?: [ int32 ](name='allowPushRoles'),
  allowPushUserIds?: [ string ](name='allowPushUserIds'),
  branch?: string(name='branch', description='This parameter is required.', example='protectBranch'),
  id?: long(name='id', example='--'),
  mergeRequestSetting?: {
    allowMergeRequestRoles?: [ int32 ](name='allowMergeRequestRoles'),
    defaultAssignees?: [ string ](name='defaultAssignees'),
    isAllowSelfApproval?: boolean(name='isAllowSelfApproval', example='true'),
    isRequireDiscussionProcessed?: boolean(name='isRequireDiscussionProcessed', example='true'),
    isRequired?: boolean(name='isRequired', example='true'),
    isResetApprovalWhenNewPush?: boolean(name='isResetApprovalWhenNewPush', example='false'),
    minimumApproval?: int32(name='minimumApproval', example='1'),
    mrMode?: string(name='mrMode', example='general'),
    whiteList?: string(name='whiteList', example='**.java'),
  }(name='mergeRequestSetting'),
  testSettingDTO?: {
    checkConfig?: {
      checkItems?: [ 
        {
          isRequired?: boolean(name='isRequired', example='false'),
          name?: string(name='name'),
        }
      ](name='checkItems'),
    }(name='checkConfig'),
    checkTaskQualityConfig?: {
      bizNo?: string(name='bizNo', example='123456'),
      enabled?: boolean(name='enabled', example='false'),
      message?: string(name='message', example='test_task_quality'),
      taskName?: string(name='taskName', example='bz-task-quality'),
    }(name='checkTaskQualityConfig'),
    codeGuidelinesDetection?: {
      enabled?: boolean(name='enabled', example='false'),
      message?: string(name='message', example='test_code_guide_lines'),
    }(name='codeGuidelinesDetection'),
    isRequired?: boolean(name='isRequired', example='false'),
    sensitiveInfoDetection?: {
      enabled?: boolean(name='enabled', example='false'),
      message?: string(name='message', example='test_code_sensitive_info'),
    }(name='sensitiveInfoDetection'),
  }(name='testSettingDTO'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model CreateProtectdBranchResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='C2F153F6-BB43-50C4-9F4F-40593203E19A'),
  result?: {
    allowMergeRoles?: [ int32 ](name='allowMergeRoles'),
    allowMergeUserIds?: [ long ](name='allowMergeUserIds'),
    allowPushRoles?: [ int32 ](name='allowPushRoles'),
    allowPushUserIds?: [ long ](name='allowPushUserIds'),
    branch?: string(name='branch', example='protectBranch'),
    id?: long(name='id', example='5240'),
    mergeRequestSetting?: {
      allowMergeRequestRoles?: [ int32 ](name='allowMergeRequestRoles'),
      defaultAssignees?: [ string ](name='defaultAssignees'),
      isAllowSelfApproval?: boolean(name='isAllowSelfApproval', example='true'),
      isRequireDiscussionProcessed?: boolean(name='isRequireDiscussionProcessed', example='true'),
      isRequired?: boolean(name='isRequired', example='true'),
      isResetApprovalWhenNewPush?: boolean(name='isResetApprovalWhenNewPush', example='false'),
      minimumApproval?: int32(name='minimumApproval', example='1'),
      mrMode?: string(name='mrMode', example='general'),
      whiteList?: string(name='whiteList', example='**.java'),
    }(name='mergeRequestSetting'),
    testSettingDTO?: {
      checkConfig?: {
        checkItems?: [ 
          {
            isRequired?: boolean(name='isRequired', example='false'),
            name?: string(name='name'),
          }
        ](name='checkItems'),
      }(name='checkConfig'),
      checkTaskQualityConfig?: {
        bizNo?: string(name='bizNo', example='123456'),
        enabled?: boolean(name='enabled', example='false'),
        message?: string(name='message', example='test_task_quality'),
        taskName?: string(name='taskName', example='biz-task-quality'),
      }(name='checkTaskQualityConfig'),
      codeGuidelinesDetection?: {
        enabled?: boolean(name='enabled', example='false'),
        message?: string(name='message', example='test_code_guide_lines'),
      }(name='codeGuidelinesDetection'),
      isRequired?: boolean(name='isRequired', example='false'),
      sensitiveInfoDetection?: {
        enabled?: boolean(name='enabled', example='false'),
        message?: string(name='message', example='test_code_sensitive_info'),
      }(name='sensitiveInfoDetection'),
    }(name='testSettingDTO'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreateProtectdBranchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProtectdBranchResponseBody(name='body'),
}

/**
 * @summary 创建保护分支
 *
 * @param request CreateProtectdBranchRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProtectdBranchResponse
 */
async function createProtectdBranchWithOptions(repositoryId: string, request: CreateProtectdBranchRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateProtectdBranchResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.allowMergeRoles)) {
    body['allowMergeRoles'] = request.allowMergeRoles;
  }
  if (!Util.isUnset(request.allowMergeUserIds)) {
    body['allowMergeUserIds'] = request.allowMergeUserIds;
  }
  if (!Util.isUnset(request.allowPushRoles)) {
    body['allowPushRoles'] = request.allowPushRoles;
  }
  if (!Util.isUnset(request.allowPushUserIds)) {
    body['allowPushUserIds'] = request.allowPushUserIds;
  }
  if (!Util.isUnset(request.branch)) {
    body['branch'] = request.branch;
  }
  if (!Util.isUnset(request.id)) {
    body['id'] = request.id;
  }
  if (!Util.isUnset(request.mergeRequestSetting)) {
    body['mergeRequestSetting'] = request.mergeRequestSetting;
  }
  if (!Util.isUnset(request.testSettingDTO)) {
    body['testSettingDTO'] = request.testSettingDTO;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProtectdBranch',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/protect_branches`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建保护分支
 *
 * @param request CreateProtectdBranchRequest
 * @return CreateProtectdBranchResponse
 */
async function createProtectdBranch(repositoryId: string, request: CreateProtectdBranchRequest): CreateProtectdBranchResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createProtectdBranchWithOptions(repositoryId, request, headers, runtime);
}

model CreatePushRuleRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  ruleInfos?: [ 
    {
      checkerName?: string(name='checkerName', example='CommitMessageChecker'),
      checkerType?: string(name='checkerType', example='warn'),
      extraMessage?: string(name='extraMessage', example='user@example.com'),
      fileRuleRegexes?: [ string ](name='fileRuleRegexes'),
    }
  ](name='ruleInfos', description='This parameter is required.'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
}

model CreatePushRuleResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    gmtCreate?: string(name='gmtCreate', example='2023-09-03T18:20:06+08:00'),
    gmtModified?: string(name='gmtModified', example='2023-09-03T18:20:06+08:00'),
    id?: long(name='id', example='2077'),
    ruleInfos?: [ 
      {
        checkerName?: string(name='checkerName', example='ForcePushChecker'),
        checkerType?: string(name='checkerType', example='warn'),
        extraMessage?: string(name='extraMessage', example='disabled'),
        fileRuleRegexes?: [ string ](name='fileRuleRegexes'),
      }
    ](name='ruleInfos'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreatePushRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePushRuleResponseBody(name='body'),
}

/**
 * @summary 创建推送规则
 *
 * @param request CreatePushRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePushRuleResponse
 */
async function createPushRuleWithOptions(repositoryId: string, request: CreatePushRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreatePushRuleResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.ruleInfos)) {
    body['ruleInfos'] = request.ruleInfos;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreatePushRule',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/${OpenApiUtil.getEncodeParam(repositoryId)}/push_rule`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建推送规则
 *
 * @param request CreatePushRuleRequest
 * @return CreatePushRuleResponse
 */
async function createPushRule(repositoryId: string, request: CreatePushRuleRequest): CreatePushRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createPushRuleWithOptions(repositoryId, request, headers, runtime);
}

model CreateRepositoryRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
  description?: string(name='description'),
  gitignoreType?: string(name='gitignoreType', example='Java'),
  importAccount?: string(name='importAccount', example='codeup-test'),
  importDemoProject?: boolean(name='importDemoProject', example='true'),
  importRepoType?: string(name='importRepoType', example='GIT'),
  importToken?: string(name='importToken', example='xxxxx'),
  importTokenEncrypted?: string(name='importTokenEncrypted', example='text'),
  importUrl?: string(name='importUrl', example='https://github.com/a/b.git'),
  initStandardService?: boolean(name='initStandardService', example='true'),
  isCryptoEnabled?: boolean(name='isCryptoEnabled', example='false'),
  localImportUrl?: string(name='localImportUrl', example='""'),
  name?: string(name='name', description='This parameter is required.'),
  namespaceId?: long(name='namespaceId'),
  path?: string(name='path'),
  readmeType?: string(name='readmeType', example='USER_GUIDE'),
  visibilityLevel?: int32(name='visibilityLevel', example='0'),
  createParentPath?: boolean(name='createParentPath', example='true'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
  sync?: boolean(name='sync', example='false'),
}

model CreateRepositoryResponseBody = {
  errorCode?: string(name='errorCode', example='401'),
  errorMessage?: string(name='errorMessage', example='SYSTEM_UNAUTHORIZED_ERROR'),
  requestId?: string(name='requestId', example='F590C9D8-E908-5B6C-95AC-56B7E8011FFA'),
  result?: {
    importFromSvn?: boolean(name='Import_from_svn', example='false'),
    archived?: boolean(name='archived', example='false'),
    avatarUrl?: string(name='avatar_url', example='""'),
    createdAt?: string(name='createdAt', example='2022-01-14T21:08:26+08:00'),
    creatorId?: long(name='creatorId', example='1233'),
    defaultBranch?: string(name='defaultBranch', example='master'),
    demoProject?: boolean(name='demoProject', example='false'),
    description?: string(name='description'),
    httpUrlToRepo?: string(name='httpUrlToRepo', example='""'),
    id?: long(name='id', description='id', example='2959'),
    lastActivityAt?: string(name='lastActivityAt', example='2022-01-14T21:08:26+08:00'),
    name?: string(name='name', example='codeupTest'),
    nameWithNamespace?: string(name='nameWithNamespace', example='codeup-test-org / test-codeup'),
    namespace?: {
      avatar?: string(name='avatar', example='""'),
      createdAt?: string(name='createdAt', example='2022-01-14T21:08:26+08:00'),
      description?: string(name='description', example='codeup repo description'),
      id?: long(name='id', description='id', example='3194'),
      name?: string(name='name', example='codeup'),
      ownerId?: long(name='ownerId', example='123'),
      path?: string(name='path', example='codeup'),
      public?: boolean(name='public', example='true'),
      updatedAt?: string(name='updatedAt', example='2022-01-14T21:08:26+08:00'),
      visibilityLevel?: string(name='visibilityLevel', example='0'),
    }(name='namespace'),
    path?: string(name='path', example='test-codeup'),
    pathWithNamespace?: string(name='pathWithNamespace', example='codeup-test-org/test-codeup'),
    sshUrlToRepo?: string(name='sshUrlToRepo', example='""'),
    visibilityLevel?: string(name='visibilityLevel', example='0'),
    webUrl?: string(name='webUrl', description='web url', example='""'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreateRepositoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRepositoryResponseBody(name='body'),
}

/**
 * @summary 创建(导入)代码库
 *
 * @param request CreateRepositoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRepositoryResponse
 */
async function createRepositoryWithOptions(request: CreateRepositoryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateRepositoryResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.createParentPath)) {
    query['createParentPath'] = request.createParentPath;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.sync)) {
    query['sync'] = request.sync;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.avatarUrl)) {
    body['avatarUrl'] = request.avatarUrl;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.gitignoreType)) {
    body['gitignoreType'] = request.gitignoreType;
  }
  if (!Util.isUnset(request.importAccount)) {
    body['importAccount'] = request.importAccount;
  }
  if (!Util.isUnset(request.importDemoProject)) {
    body['importDemoProject'] = request.importDemoProject;
  }
  if (!Util.isUnset(request.importRepoType)) {
    body['importRepoType'] = request.importRepoType;
  }
  if (!Util.isUnset(request.importToken)) {
    body['importToken'] = request.importToken;
  }
  if (!Util.isUnset(request.importTokenEncrypted)) {
    body['importTokenEncrypted'] = request.importTokenEncrypted;
  }
  if (!Util.isUnset(request.importUrl)) {
    body['importUrl'] = request.importUrl;
  }
  if (!Util.isUnset(request.initStandardService)) {
    body['initStandardService'] = request.initStandardService;
  }
  if (!Util.isUnset(request.isCryptoEnabled)) {
    body['isCryptoEnabled'] = request.isCryptoEnabled;
  }
  if (!Util.isUnset(request.localImportUrl)) {
    body['localImportUrl'] = request.localImportUrl;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.namespaceId)) {
    body['namespaceId'] = request.namespaceId;
  }
  if (!Util.isUnset(request.path)) {
    body['path'] = request.path;
  }
  if (!Util.isUnset(request.readmeType)) {
    body['readmeType'] = request.readmeType;
  }
  if (!Util.isUnset(request.visibilityLevel)) {
    body['visibilityLevel'] = request.visibilityLevel;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateRepository',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建(导入)代码库
 *
 * @param request CreateRepositoryRequest
 * @return CreateRepositoryResponse
 */
async function createRepository(request: CreateRepositoryRequest): CreateRepositoryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createRepositoryWithOptions(request, headers, runtime);
}

model CreateRepositoryGroupRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
  description?: string(name='description'),
  name?: string(name='name', description='This parameter is required.', example='test-create-group'),
  parentId?: long(name='parentId', description='This parameter is required.', example='26842'),
  path?: string(name='path', description='This parameter is required.', example='test-create-group'),
  visibilityLevel?: int32(name='visibilityLevel', description='This parameter is required.', example='10'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model CreateRepositoryGroupResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: {
    avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
    description?: string(name='description'),
    id?: long(name='id', example='18685'),
    name?: string(name='name', example='test-create-group'),
    nameWithNamespace?: string(name='nameWithNamespace'),
    ownerId?: long(name='ownerId', example='19230'),
    parentId?: long(name='parentId', example='26842'),
    path?: string(name='path', example='test-create-group'),
    pathWithNamespace?: string(name='pathWithNamespace', example='codeup-test-org/test-create-group'),
    type?: string(name='type', example='Group'),
    visibilityLevel?: int32(name='visibilityLevel', example='10'),
    webUrl?: string(name='webUrl', example='""'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreateRepositoryGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRepositoryGroupResponseBody(name='body'),
}

/**
 * @summary 创建代码组
 *
 * @param request CreateRepositoryGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRepositoryGroupResponse
 */
async function createRepositoryGroupWithOptions(request: CreateRepositoryGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateRepositoryGroupResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.avatarUrl)) {
    body['avatarUrl'] = request.avatarUrl;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.parentId)) {
    body['parentId'] = request.parentId;
  }
  if (!Util.isUnset(request.path)) {
    body['path'] = request.path;
  }
  if (!Util.isUnset(request.visibilityLevel)) {
    body['visibilityLevel'] = request.visibilityLevel;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateRepositoryGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/groups/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建代码组
 *
 * @param request CreateRepositoryGroupRequest
 * @return CreateRepositoryGroupResponse
 */
async function createRepositoryGroup(request: CreateRepositoryGroupRequest): CreateRepositoryGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createRepositoryGroupWithOptions(request, headers, runtime);
}

model CreateResourceMemberRequest {
  accountId?: string(name='accountId', description='This parameter is required.', example='1111111111111'),
  roleName?: string(name='roleName', description='This parameter is required.', example='admin'),
}

model CreateResourceMemberResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model CreateResourceMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateResourceMemberResponseBody(name='body'),
}

/**
 * @summary 插入资源成员
 *
 * @param request CreateResourceMemberRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateResourceMemberResponse
 */
async function createResourceMemberWithOptions(organizationId: string, resourceType: string, resourceId: string, request: CreateResourceMemberRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateResourceMemberResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountId)) {
    body['accountId'] = request.accountId;
  }
  if (!Util.isUnset(request.roleName)) {
    body['roleName'] = request.roleName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateResourceMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/${OpenApiUtil.getEncodeParam(resourceType)}/${OpenApiUtil.getEncodeParam(resourceId)}/members`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 插入资源成员
 *
 * @param request CreateResourceMemberRequest
 * @return CreateResourceMemberResponse
 */
async function createResourceMember(organizationId: string, resourceType: string, resourceId: string, request: CreateResourceMemberRequest): CreateResourceMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createResourceMemberWithOptions(organizationId, resourceType, resourceId, request, headers, runtime);
}

model CreateServiceAuthRequest {
  serviceAuthType?: string(name='serviceAuthType', description='This parameter is required.', example='RAM'),
}

model CreateServiceAuthResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='""'),
  id?: string(name='id', example='1223'),
  requestId?: string(name='requestId', description='Id of the request', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model CreateServiceAuthResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateServiceAuthResponseBody(name='body'),
}

/**
 * @summary 创建服务授权
 *
 * @param request CreateServiceAuthRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateServiceAuthResponse
 */
async function createServiceAuthWithOptions(organizationId: string, request: CreateServiceAuthRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateServiceAuthResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.serviceAuthType)) {
    query['serviceAuthType'] = request.serviceAuthType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateServiceAuth',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/serviceAuths`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建服务授权
 *
 * @param request CreateServiceAuthRequest
 * @return CreateServiceAuthResponse
 */
async function createServiceAuth(organizationId: string, request: CreateServiceAuthRequest): CreateServiceAuthResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createServiceAuthWithOptions(organizationId, request, headers, runtime);
}

model CreateServiceConnectionRequest {
  authType?: string(name='authType', description='This parameter is required.', example='CREDENTIAL'),
  connectionName?: string(name='connectionName', description='This parameter is required.'),
  connectionType?: string(name='connectionType', description='This parameter is required.', example='ecs'),
  scope?: string(name='scope', description='This parameter is required.', example='PERSON'),
  serviceAuthId?: long(name='serviceAuthId', description='This parameter is required.', example='111'),
}

model CreateServiceConnectionResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  id?: long(name='id', example='19224'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model CreateServiceConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateServiceConnectionResponseBody(name='body'),
}

/**
 * @summary 创建服务连接
 *
 * @param request CreateServiceConnectionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateServiceConnectionResponse
 */
async function createServiceConnectionWithOptions(organizationId: string, request: CreateServiceConnectionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateServiceConnectionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authType)) {
    body['authType'] = request.authType;
  }
  if (!Util.isUnset(request.connectionName)) {
    body['connectionName'] = request.connectionName;
  }
  if (!Util.isUnset(request.connectionType)) {
    body['connectionType'] = request.connectionType;
  }
  if (!Util.isUnset(request.scope)) {
    body['scope'] = request.scope;
  }
  if (!Util.isUnset(request.serviceAuthId)) {
    body['serviceAuthId'] = request.serviceAuthId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateServiceConnection',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/createServiceConnection`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建服务连接
 *
 * @param request CreateServiceConnectionRequest
 * @return CreateServiceConnectionResponse
 */
async function createServiceConnection(organizationId: string, request: CreateServiceConnectionRequest): CreateServiceConnectionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createServiceConnectionWithOptions(organizationId, request, headers, runtime);
}

model CreateServiceCredentialRequest {
  name?: string(name='name', description='This parameter is required.', example='张三的Git证书'),
  password?: string(name='password', description='This parameter is required.', example='zhangsan'),
  scope?: string(name='scope', example='PERSON'),
  type?: string(name='type', description='This parameter is required.', example='USERNAME_PASSWORD'),
  username?: string(name='username', description='This parameter is required.', example='zhangsan'),
}

model CreateServiceCredentialResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  id?: long(name='id', example='11222'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model CreateServiceCredentialResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateServiceCredentialResponseBody(name='body'),
}

/**
 * @summary 创建用户名密码类型的证书
 *
 * @param request CreateServiceCredentialRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateServiceCredentialResponse
 */
async function createServiceCredentialWithOptions(organizationId: string, request: CreateServiceCredentialRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateServiceCredentialResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.password)) {
    body['password'] = request.password;
  }
  if (!Util.isUnset(request.scope)) {
    body['scope'] = request.scope;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }
  if (!Util.isUnset(request.username)) {
    body['username'] = request.username;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateServiceCredential',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/serviceCredentials`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建用户名密码类型的证书
 *
 * @param request CreateServiceCredentialRequest
 * @return CreateServiceCredentialResponse
 */
async function createServiceCredential(organizationId: string, request: CreateServiceCredentialRequest): CreateServiceCredentialResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createServiceCredentialWithOptions(organizationId, request, headers, runtime);
}

model CreateSprintRequest {
  endDate?: string(name='endDate', example='2021-12-02'),
  name?: string(name='name', description='This parameter is required.', example='xxx'),
  spaceIdentifier?: string(name='spaceIdentifier', description='This parameter is required.', example='asd345xxxxx9q9845xxxxx34'),
  staffIds?: [ string ](name='staffIds', description='This parameter is required.'),
  startDate?: string(name='startDate', example='2021-12-01'),
}

model CreateSprintResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  sprint?: {
    creator?: string(name='creator', example='19xx7043xxxxxxx914'),
    description?: string(name='description', example='xxx'),
    endDate?: long(name='endDate', example='1623916393000'),
    gmtCreate?: long(name='gmtCreate', example='1623916393000'),
    gmtModified?: long(name='gmtModified', example='1623916393000'),
    identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
    modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
    name?: string(name='name', example='demo示例项目'),
    scope?: string(name='scope', example='public'),
    spaceIdentifier?: string(name='spaceIdentifier', example='5e70xxxxxxcd000xxxxe96'),
    startDate?: long(name='startDate', example='1638403200000'),
    status?: string(name='status', example='TODO'),
  }(name='sprint'),
  success?: boolean(name='success', example='true'),
}

model CreateSprintResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSprintResponseBody(name='body'),
}

/**
 * @summary 创建迭代
 *
 * @param request CreateSprintRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSprintResponse
 */
async function createSprintWithOptions(organizationId: string, request: CreateSprintRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateSprintResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endDate)) {
    body['endDate'] = request.endDate;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.spaceIdentifier)) {
    body['spaceIdentifier'] = request.spaceIdentifier;
  }
  if (!Util.isUnset(request.staffIds)) {
    body['staffIds'] = request.staffIds;
  }
  if (!Util.isUnset(request.startDate)) {
    body['startDate'] = request.startDate;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateSprint',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/sprints/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建迭代
 *
 * @param request CreateSprintRequest
 * @return CreateSprintResponse
 */
async function createSprint(organizationId: string, request: CreateSprintRequest): CreateSprintResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createSprintWithOptions(organizationId, request, headers, runtime);
}

model CreateSshKeyResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  sshKey?: {
    id?: long(name='id', example='123'),
    publicKey?: string(name='publicKey', example='assssssssssss'),
  }(name='sshKey'),
  success?: boolean(name='success', example='true'),
}

model CreateSshKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSshKeyResponseBody(name='body'),
}

/**
 * @summary 创建企业公钥
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSshKeyResponse
 */
async function createSshKeyWithOptions(organizationId: string, headers: map[string]string, runtime: Util.RuntimeOptions): CreateSshKeyResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'CreateSshKey',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/sshKey`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建企业公钥
 *
 * @return CreateSshKeyResponse
 */
async function createSshKey(organizationId: string): CreateSshKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createSshKeyWithOptions(organizationId, headers, runtime);
}

model CreateTagRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  message?: string(name='message'),
  ref?: string(name='ref', description='This parameter is required.', example='master'),
  tagName?: string(name='tagName', description='This parameter is required.', example='v1.0'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model CreateTagResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: {
    commit?: {
      authorEmail?: string(name='authorEmail', example='username@example.com'),
      authorName?: string(name='authorName'),
      authoredDate?: string(name='authoredDate', example='2022-03-18 10:00:00'),
      committedDate?: string(name='committedDate', example='2022-03-18 09:00:00'),
      committerEmail?: string(name='committerEmail', example='username@example.com'),
      committerName?: string(name='committerName'),
      createdAt?: string(name='createdAt', example='2022-03-18 10:00:00'),
      id?: string(name='id', example='e0297d8fb0393c833a8531e7cc8832739e3cba6d'),
      message?: string(name='message'),
      parentIds?: [ string ](name='parentIds'),
      shortId?: string(name='shortId', example='e0297d8f'),
      title?: string(name='title'),
    }(name='commit'),
    id?: string(name='id', example='0e3b6aa5eab2b086b59fde74766b28d4e5faab0d'),
    message?: string(name='message'),
    name?: string(name='name', example='v1.0'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreateTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTagResponseBody(name='body'),
}

/**
 * @summary 创建标签Tag
 *
 * @param request CreateTagRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTagResponse
 */
async function createTagWithOptions(repositoryId: string, request: CreateTagRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateTagResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.message)) {
    body['message'] = request.message;
  }
  if (!Util.isUnset(request.ref)) {
    body['ref'] = request.ref;
  }
  if (!Util.isUnset(request.tagName)) {
    body['tagName'] = request.tagName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTag',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/tags/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建标签Tag
 *
 * @param request CreateTagRequest
 * @return CreateTagResponse
 */
async function createTag(repositoryId: string, request: CreateTagRequest): CreateTagResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createTagWithOptions(repositoryId, request, headers, runtime);
}

model CreateTestCaseRequest {
  assignedTo?: string(name='assignedTo', description='This parameter is required.', example='19xxxx31947xxxx'),
  directoryIdentifier?: string(name='directoryIdentifier', description='This parameter is required.', example='fdd395xxxxx9q9845xxxxx23'),
  fieldValueList?: [ 
    {
      fieldIdentifier?: string(name='fieldIdentifier', example='6aexxxxxa1d98c09c60xxxx16'),
      value?: string(name='value', example='77c7fb03c4186c8691d6...'),
    }
  ](name='fieldValueList'),
  priority?: string(name='priority', example='ik3dexxxxxfdfds1xxxxx23'),
  spaceIdentifier?: string(name='spaceIdentifier', description='This parameter is required.', example='asd345xxxxx9q9845xxxxx34'),
  subject?: string(name='subject', description='This parameter is required.'),
  tags?: [ string ](name='tags'),
  testcaseStepContentInfo?: {
    precondition?: string(name='precondition'),
    stepResultList?: [ 
      {
        expected?: string(name='expected'),
        step?: string(name='step'),
      }
    ](name='stepResultList'),
    stepType?: string(name='stepType', description='This parameter is required.', example='TEXT'),
  }(name='testcaseStepContentInfo'),
}

model CreateTestCaseResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', description='Id of the request', example='18E50717-93A4-53BC-A30D-963F742A1CE6'),
  success?: boolean(name='success', example='true'),
  testcase?: {
    assignedTo?: {
      assignIdentifier?: string(name='assignIdentifier', example='134xxx343xxxxx'),
      name?: string(name='name'),
      tbRoleId?: string(name='tbRoleId', example='3c2253c22xxxxxxxx53a'),
    }(name='assignedTo'),
    categoryIdentifier?: string(name='categoryIdentifier', example='TestCase'),
    creator?: {
      createIdentifier?: string(name='createIdentifier', example='134xxx343xxxxx'),
      name?: string(name='name'),
    }(name='creator'),
    detailInfo?: {
      expectedResult?: {
        expectContent?: string(name='expectContent'),
        expectContentType?: string(name='expectContentType', example='RICHTEXT'),
        expectIdentifier?: string(name='expectIdentifier', example='59253164xxxxxxf2e98dbc7e27'),
      }(name='expectedResult'),
      precondition?: {
        preContent?: string(name='preContent'),
        preContentType?: string(name='preContentType', example='RICHTEXT'),
        preIdentifier?: string(name='preIdentifier', example='59253164xxxxxxf2e98dbc7e27'),
      }(name='precondition'),
      stepContent?: {
        stepContent?: string(name='stepContent'),
        stepContentType?: string(name='stepContentType', example='RICHTEXT'),
        stepIdentifier?: string(name='stepIdentifier', example='59253164xxxxxxf2e98dbc7e27'),
      }(name='stepContent'),
      stepType?: string(name='stepType', example='TEXT/TABLE'),
    }(name='detailInfo'),
    directory?: {
      childIdentifier?: string(name='childIdentifier', example='0bc1150dcxxxxxxxx04c'),
      directoryIdentifier?: string(name='directoryIdentifier', example='0bc1150dcxxxxxxxx04c'),
      name?: string(name='name'),
      pathName?: [ string ](name='pathName'),
    }(name='directory'),
    identifier?: string(name='identifier', example='5a73f81c834d013361d92bdcce'),
    modifier?: {
      modifyIdentifier?: string(name='modifyIdentifier', example='134xxx343xxxxx'),
      name?: string(name='name'),
    }(name='modifier'),
    spaceIdentifier?: string(name='spaceIdentifier', example='a18571eba8fe9267cd8375fc06'),
    spaceType?: string(name='spaceType', example='TestRepo'),
    subject?: string(name='subject'),
  }(name='testcase'),
}

model CreateTestCaseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTestCaseResponseBody(name='body'),
}

/**
 * @summary 创建测试用例
 *
 * @param request CreateTestCaseRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTestCaseResponse
 */
async function createTestCaseWithOptions(organizationId: string, request: CreateTestCaseRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateTestCaseResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.assignedTo)) {
    body['assignedTo'] = request.assignedTo;
  }
  if (!Util.isUnset(request.directoryIdentifier)) {
    body['directoryIdentifier'] = request.directoryIdentifier;
  }
  if (!Util.isUnset(request.fieldValueList)) {
    body['fieldValueList'] = request.fieldValueList;
  }
  if (!Util.isUnset(request.priority)) {
    body['priority'] = request.priority;
  }
  if (!Util.isUnset(request.spaceIdentifier)) {
    body['spaceIdentifier'] = request.spaceIdentifier;
  }
  if (!Util.isUnset(request.subject)) {
    body['subject'] = request.subject;
  }
  if (!Util.isUnset(request.tags)) {
    body['tags'] = request.tags;
  }
  if (!Util.isUnset(request.testcaseStepContentInfo)) {
    body['testcaseStepContentInfo'] = request.testcaseStepContentInfo;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTestCase',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/testhub/testcase`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建测试用例
 *
 * @param request CreateTestCaseRequest
 * @return CreateTestCaseResponse
 */
async function createTestCase(organizationId: string, request: CreateTestCaseRequest): CreateTestCaseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createTestCaseWithOptions(organizationId, request, headers, runtime);
}

model CreateUserKeyRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  expireTime?: string(name='expireTime', example='2022-03-12 12:00:00'),
  keyScope?: string(name='keyScope', description='This parameter is required.', example='ALL'),
  publicKey?: string(name='publicKey', description='This parameter is required.', example='xxx'),
  title?: string(name='title', description='This parameter is required.', example='SSH Title'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
}

model CreateUserKeyResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='SYSTEM_UNKNOWN_ERROR'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    createdAt?: string(name='createdAt', example='2022-03-12 12:00:00'),
    expireTime?: string(name='expireTime', example='2022-03-12 12:00:00'),
    fingerPrint?: string(name='fingerPrint', example='xxx'),
    id?: long(name='id', example='11072'),
    keyScope?: string(name='keyScope', example='ALL'),
    lastUsedTime?: string(name='lastUsedTime', example='2022-03-12 12:00:00'),
    publicKey?: string(name='publicKey', example='xxx'),
    title?: string(name='title', example='My Title'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model CreateUserKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateUserKeyResponseBody(name='body'),
}

/**
 * @summary 创建SSH Key密钥
 *
 * @param request CreateUserKeyRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateUserKeyResponse
 */
async function createUserKeyWithOptions(request: CreateUserKeyRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateUserKeyResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.expireTime)) {
    body['expireTime'] = request.expireTime;
  }
  if (!Util.isUnset(request.keyScope)) {
    body['keyScope'] = request.keyScope;
  }
  if (!Util.isUnset(request.publicKey)) {
    body['publicKey'] = request.publicKey;
  }
  if (!Util.isUnset(request.title)) {
    body['title'] = request.title;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateUserKey',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v3/user/keys/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建SSH Key密钥
 *
 * @param request CreateUserKeyRequest
 * @return CreateUserKeyResponse
 */
async function createUserKey(request: CreateUserKeyRequest): CreateUserKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createUserKeyWithOptions(request, headers, runtime);
}

model CreateVariableGroupRequest {
  description?: string(name='description', example='变量组'),
  name?: string(name='name', description='This parameter is required.', example='变量组'),
  variables?: string(name='variables', description='This parameter is required.', example='[{"isEncrypted":true,"name":"name1","value":"vaue1"}]'),
}

model CreateVariableGroupResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  variableGroupId?: long(name='variableGroupId', example='1234'),
}

model CreateVariableGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateVariableGroupResponseBody(name='body'),
}

/**
 * @summary 创建变量组
 *
 * @param request CreateVariableGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateVariableGroupResponse
 */
async function createVariableGroupWithOptions(organizationId: string, request: CreateVariableGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateVariableGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.variables)) {
    body['variables'] = request.variables;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateVariableGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/variableGroups`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建变量组
 *
 * @param request CreateVariableGroupRequest
 * @return CreateVariableGroupResponse
 */
async function createVariableGroup(organizationId: string, request: CreateVariableGroupRequest): CreateVariableGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createVariableGroupWithOptions(organizationId, request, headers, runtime);
}

model CreateWorkitemRequest {
  assignedTo?: string(name='assignedTo', description='This parameter is required.', example='19xxxx31947xxxx'),
  category?: string(name='category', description='This parameter is required.', example='Req'),
  description?: string(name='description', example='测试内容'),
  descriptionFormat?: string(name='descriptionFormat', example='RICHTEXT'),
  fieldValueList?: [ 
    {
      fieldIdentifier?: string(name='fieldIdentifier', example='6aexxxxxa1d98c09c60xxxx16'),
      value?: string(name='value', example='77c7fb03c4186c8691d6...'),
      workitemIdentifier?: string(name='workitemIdentifier', example='null'),
    }
  ](name='fieldValueList'),
  parent?: string(name='parent', example='3a0c9cdd24ae1e1995b8...'),
  participant?: [ string ](name='participant'),
  space?: string(name='space', description='This parameter is required.', example='asd345xxxxx9q9845xxxxx34'),
  spaceIdentifier?: string(name='spaceIdentifier', description='This parameter is required.', example='asd345xxxxx9q9845xxxxx34'),
  spaceType?: string(name='spaceType', description='This parameter is required.', example='Project'),
  sprint?: [ string ](name='sprint'),
  subject?: string(name='subject', description='This parameter is required.', example='测试工作项'),
  tracker?: [ string ](name='tracker'),
  verifier?: [ string ](name='verifier'),
  workitemType?: string(name='workitemType', description='This parameter is required.', example='9uyxxxxxre573f561dxxn40'),
}

model CreateWorkitemResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  workitem?: {
    assignedTo?: string(name='assignedTo', example='19xx7043xxxxxxx914'),
    categoryIdentifier?: string(name='categoryIdentifier', example='Req'),
    creator?: string(name='creator', example='19xx7043xxxxxxx914'),
    document?: string(name='document', example='html格式'),
    documentFormat?: string(name='documentFormat'),
    gmtCreate?: long(name='gmtCreate', example='1640850318000'),
    gmtModified?: long(name='gmtModified', example='1640850318000'),
    identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
    logicalStatus?: string(name='logicalStatus', example='NORMAL'),
    modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
    parentIdentifier?: string(name='parentIdentifier', example='e8bxxxxxxxxxxxxxxxx24'),
    serialNumber?: string(name='serialNumber', example='ABCD-1'),
    spaceIdentifier?: string(name='spaceIdentifier', example='e8b26xxxxx6e76aa20xxxxx23'),
    spaceName?: string(name='spaceName', example='需求项目'),
    spaceType?: string(name='spaceType', example='Project'),
    sprintIdentifier?: string(name='sprintIdentifier', example='75528f17703e92e5a568......'),
    status?: string(name='status', example='待处理'),
    statusIdentifier?: string(name='statusIdentifier', example='28'),
    statusStageIdentifier?: string(name='statusStageIdentifier', example='100005'),
    subject?: string(name='subject', example='测试工作项'),
    updateStatusAt?: long(name='updateStatusAt', example='1640850328000'),
    workitemTypeIdentifier?: string(name='workitemTypeIdentifier', example='9uxxxxxxre573f5xxxxxx0'),
  }(name='workitem'),
}

model CreateWorkitemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateWorkitemResponseBody(name='body'),
}

/**
 * @summary 新建工作项
 *
 * @param request CreateWorkitemRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateWorkitemResponse
 */
async function createWorkitemWithOptions(organizationId: string, request: CreateWorkitemRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateWorkitemResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.assignedTo)) {
    body['assignedTo'] = request.assignedTo;
  }
  if (!Util.isUnset(request.category)) {
    body['category'] = request.category;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.descriptionFormat)) {
    body['descriptionFormat'] = request.descriptionFormat;
  }
  if (!Util.isUnset(request.fieldValueList)) {
    body['fieldValueList'] = request.fieldValueList;
  }
  if (!Util.isUnset(request.parent)) {
    body['parent'] = request.parent;
  }
  if (!Util.isUnset(request.participant)) {
    body['participant'] = request.participant;
  }
  if (!Util.isUnset(request.space)) {
    body['space'] = request.space;
  }
  if (!Util.isUnset(request.spaceIdentifier)) {
    body['spaceIdentifier'] = request.spaceIdentifier;
  }
  if (!Util.isUnset(request.spaceType)) {
    body['spaceType'] = request.spaceType;
  }
  if (!Util.isUnset(request.sprint)) {
    body['sprint'] = request.sprint;
  }
  if (!Util.isUnset(request.subject)) {
    body['subject'] = request.subject;
  }
  if (!Util.isUnset(request.tracker)) {
    body['tracker'] = request.tracker;
  }
  if (!Util.isUnset(request.verifier)) {
    body['verifier'] = request.verifier;
  }
  if (!Util.isUnset(request.workitemType)) {
    body['workitemType'] = request.workitemType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateWorkitem',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 新建工作项
 *
 * @param request CreateWorkitemRequest
 * @return CreateWorkitemResponse
 */
async function createWorkitem(organizationId: string, request: CreateWorkitemRequest): CreateWorkitemResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createWorkitemWithOptions(organizationId, request, headers, runtime);
}

model CreateWorkitemCommentRequest {
  content?: string(name='content', description='This parameter is required.'),
  formatType?: string(name='formatType', description='This parameter is required.', example='RICHTEXT/MARKDOWN'),
  parentId?: string(name='parentId', example='26842'),
  workitemIdentifier?: string(name='workitemIdentifier', description='This parameter is required.', example='1e9903d8b3f12xxxxxf9286ef5'),
}

model CreateWorkitemCommentResponseBody = {
  comment?: {
    id?: long(name='Id', example='26842'),
    content?: string(name='content'),
    createTime?: long(name='createTime', example='1667202662000'),
    formatType?: string(name='formatType', example='RICHTEXT/MARKDOWN'),
    isTop?: boolean(name='isTop', example='true/false'),
    modifiedTime?: long(name='modifiedTime', example='1637995553000'),
    parentId?: long(name='parentId', example='26842'),
    targetIdentifier?: string(name='targetIdentifier', example='79d523806bdxxxxx95612a5154'),
    targetType?: string(name='targetType', example='workitem'),
    topTime?: long(name='topTime', example='1667202662000'),
    user?: {
      account?: string(name='account', example='13164xxxxx41068'),
      avatar?: string(name='avatar', example='https://xxxxx/thumbnail/112m7150e256dbba0d6456bafbb65c81f90d/w/200/h/200'),
      displayName?: string(name='displayName'),
      identifier?: string(name='identifier', example='1e9903d8bxxxxxxe9df9286ef5'),
      nickName?: string(name='nickName'),
      realName?: string(name='realName'),
      targetType?: string(name='targetType', example='workitem'),
    }(name='user'),
  }(name='Comment'),
  errorCode?: string(name='errorCode', example='success'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', description='Id of the request', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: string(name='success'),
}

model CreateWorkitemCommentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateWorkitemCommentResponseBody(name='body'),
}

/**
 * @summary 创建一个评论
 *
 * @param request CreateWorkitemCommentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateWorkitemCommentResponse
 */
async function createWorkitemCommentWithOptions(organizationId: string, request: CreateWorkitemCommentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateWorkitemCommentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.formatType)) {
    body['formatType'] = request.formatType;
  }
  if (!Util.isUnset(request.parentId)) {
    body['parentId'] = request.parentId;
  }
  if (!Util.isUnset(request.workitemIdentifier)) {
    body['workitemIdentifier'] = request.workitemIdentifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateWorkitemComment',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/comment`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建一个评论
 *
 * @param request CreateWorkitemCommentRequest
 * @return CreateWorkitemCommentResponse
 */
async function createWorkitemComment(organizationId: string, request: CreateWorkitemCommentRequest): CreateWorkitemCommentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createWorkitemCommentWithOptions(organizationId, request, headers, runtime);
}

model CreateWorkitemEstimateRequest {
  description?: string(name='description'),
  recordUserIdentifier?: string(name='recordUserIdentifier', description='This parameter is required.', example='1316458xxxxx41068'),
  spentTime?: string(name='spentTime', description='This parameter is required.', example='21'),
  type?: string(name='type', description='This parameter is required.', example='9144ef6b72d8exxxxx9e61a4d0'),
  workitemIdentifier?: string(name='workitemIdentifier', description='This parameter is required.', example='1e9903d8b3f1xxxxxf9286ef5'),
}

model CreateWorkitemEstimateResponseBody = {
  workitemTimeEstimate?: {
    description?: string(name='description'),
    identifier?: string(name='identifier', example='deafe5f33xxxxx6a259d8dafd'),
    recordUser?: {
      account?: string(name='account', example='1316458xxxxx41068'),
      avatar?: string(name='avatar', example='https://tcs-devops.aliyuncs.com/thumbnail/112m7150e256dbba0d6456bafbb65c81f90d/w/200/h/200'),
      dingTalkId?: string(name='dingTalkId', example='fdsad12xxx11'),
      displayName?: string(name='displayName'),
      displayNickName?: string(name='displayNickName', example='wangwu'),
      displayRealName?: string(name='displayRealName', example='wangwu'),
      email?: string(name='email', example='xxxxxxcc@xxx.com'),
      gender?: string(name='gender'),
      identifier?: string(name='identifier', example='deafe5f33xxxxx6a259d8dafd'),
      isDisabled?: boolean(name='isDisabled', example='true/false'),
      mobile?: string(name='mobile'),
      nameEn?: string(name='nameEn', example='wangwu'),
      nickName?: string(name='nickName'),
      nickNamePinyin?: string(name='nickNamePinyin', example='wangwu'),
      realName?: string(name='realName'),
      realNamePinyin?: string(name='realNamePinyin', example='wangwu'),
      stamp?: string(name='stamp'),
      tbRoleId?: string(name='tbRoleId', example='9144ef6b72d8exxxxx9e61a4d0'),
    }(name='recordUser'),
    spentTime?: long(name='spentTime', example='11'),
    type?: string(name='type', example='9144ef6b72d8exxxxx9e61a4d0'),
    workitemIdentifier?: string(name='workitemIdentifier', example='1e9903d8b3f1xxxxxf9286ef5'),
  }(name='WorkitemTimeEstimate'),
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', description='Id of the request', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success'),
}

model CreateWorkitemEstimateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateWorkitemEstimateResponseBody(name='body'),
}

/**
 * @summary 登记预计工时
 *
 * @param request CreateWorkitemEstimateRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateWorkitemEstimateResponse
 */
async function createWorkitemEstimateWithOptions(organizationId: string, request: CreateWorkitemEstimateRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateWorkitemEstimateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.recordUserIdentifier)) {
    body['recordUserIdentifier'] = request.recordUserIdentifier;
  }
  if (!Util.isUnset(request.spentTime)) {
    body['spentTime'] = request.spentTime;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }
  if (!Util.isUnset(request.workitemIdentifier)) {
    body['workitemIdentifier'] = request.workitemIdentifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateWorkitemEstimate',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/estimate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 登记预计工时
 *
 * @param request CreateWorkitemEstimateRequest
 * @return CreateWorkitemEstimateResponse
 */
async function createWorkitemEstimate(organizationId: string, request: CreateWorkitemEstimateRequest): CreateWorkitemEstimateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createWorkitemEstimateWithOptions(organizationId, request, headers, runtime);
}

model CreateWorkitemRecordRequest {
  actualTime?: string(name='actualTime', description='This parameter is required.', example='12'),
  description?: string(name='description'),
  gmtEnd?: string(name='gmtEnd', description='This parameter is required.', example='1646323200000'),
  gmtStart?: string(name='gmtStart', description='This parameter is required.', example='1667205617061'),
  recordUserIdentifier?: string(name='recordUserIdentifier', description='This parameter is required.', example='1316458xxxxx41068'),
  type?: string(name='type', description='This parameter is required.', example='deafe5f33xxxxx6a259d8dafd'),
  workitemIdentifier?: string(name='workitemIdentifier', description='This parameter is required.', example='9144ef6b72d8exxxxx9e61a4d0'),
}

model CreateWorkitemRecordResponseBody = {
  workitemTime?: {
    actualTime?: long(name='actualTime', example='12'),
    description?: string(name='description'),
    gmtEnd?: long(name='gmtEnd', example='1667205617089'),
    gmtStart?: long(name='gmtStart', example='1667205617061'),
    identifier?: string(name='identifier', example='deafe5f33xxxxx6a259d8dafd'),
    recordUser?: {
      account?: string(name='account', example='1316458xxxxx41068'),
      avatar?: string(name='avatar', example='https://tcs-devops.aliyuncs.com/thumbnail/112m7150e256dbba0d6456bafbb65c81f90d/w/200/h/200'),
      dingTalkId?: string(name='dingTalkId', example='xx12322'),
      displayName?: string(name='displayName'),
      displayNickName?: string(name='displayNickName'),
      displayRealName?: string(name='displayRealName'),
      email?: string(name='email', example='xxx@xxx.com'),
      gender?: string(name='gender'),
      identifier?: string(name='identifier', example='deafe5f33xxxxx6a259d8dafd'),
      isDisabled?: boolean(name='isDisabled', example='true/false'),
      mobile?: string(name='mobile'),
      nameEn?: string(name='nameEn', example='wangwu'),
      nickName?: string(name='nickName'),
      nickNamePinyin?: string(name='nickNamePinyin', example='wangwu'),
      realName?: string(name='realName'),
      realNamePinyin?: string(name='realNamePinyin', example='wangwu'),
      stamp?: string(name='stamp'),
      tbRoleId?: string(name='tbRoleId', example='1e9903d8b3f1xxxxxf9286ef5'),
    }(name='recordUser'),
    type?: string(name='type', example='deafe5f33xxxxx6a259d8dafd'),
    workitemIdentifier?: string(name='workitemIdentifier', example='9144ef6b72d8exxxxx9e61a4d0'),
  }(name='WorkitemTime'),
  errorCode?: string(name='errorCode', example='success'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', description='Id of the request', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model CreateWorkitemRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateWorkitemRecordResponseBody(name='body'),
}

/**
 * @summary 登记实际工时
 *
 * @param request CreateWorkitemRecordRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateWorkitemRecordResponse
 */
async function createWorkitemRecordWithOptions(organizationId: string, request: CreateWorkitemRecordRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateWorkitemRecordResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.actualTime)) {
    body['actualTime'] = request.actualTime;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.gmtEnd)) {
    body['gmtEnd'] = request.gmtEnd;
  }
  if (!Util.isUnset(request.gmtStart)) {
    body['gmtStart'] = request.gmtStart;
  }
  if (!Util.isUnset(request.recordUserIdentifier)) {
    body['recordUserIdentifier'] = request.recordUserIdentifier;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }
  if (!Util.isUnset(request.workitemIdentifier)) {
    body['workitemIdentifier'] = request.workitemIdentifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateWorkitemRecord',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/record`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 登记实际工时
 *
 * @param request CreateWorkitemRecordRequest
 * @return CreateWorkitemRecordResponse
 */
async function createWorkitemRecord(organizationId: string, request: CreateWorkitemRecordRequest): CreateWorkitemRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createWorkitemRecordWithOptions(organizationId, request, headers, runtime);
}

model CreateWorkitemV2Request {
  assignedTo?: string(name='assignedTo', description='This parameter is required.', example='19xxxx31947xxxx'),
  category?: string(name='category', description='This parameter is required.', example='Req'),
  description?: string(name='description'),
  fieldValueList?: [ 
    {
      fieldIdentifier?: string(name='fieldIdentifier', example='6aexxxxxa1d98c09c60xxxx16'),
      value?: string(name='value', example='10'),
    }
  ](name='fieldValueList'),
  parentIdentifier?: string(name='parentIdentifier', example='11223331122'),
  participants?: [ string ](name='participants'),
  spaceIdentifier?: string(name='spaceIdentifier', description='This parameter is required.', example='asd345xxxxx9q9845xxxxx34'),
  sprintIdentifier?: string(name='sprintIdentifier', example='455532323455'),
  subject?: string(name='subject', description='This parameter is required.'),
  tags?: [ string ](name='tags'),
  trackers?: [ string ](name='trackers'),
  verifier?: string(name='verifier', example='1561159309......'),
  versions?: [ string ](name='versions'),
  workitemTypeIdentifier?: string(name='workitemTypeIdentifier', description='This parameter is required.', example='9uy29901re573f561d69jn40'),
}

model CreateWorkitemV2ResponseBody = {
  errorCode?: string(name='errorCode', example='InvalidTagGroup.IdNotFound'),
  errorMessage?: string(name='errorMessage', example='SYSTEM_UNKNOWN_ERROR'),
  requestId?: string(name='requestId', example='EAE03103-5497-58D1-9169-E524DDE8604C'),
  success?: string(name='success', example='true'),
  workitemIdentifier?: string(name='workitemIdentifier', example='11234455454355'),
}

model CreateWorkitemV2Response = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateWorkitemV2ResponseBody(name='body'),
}

/**
 * @summary 创建工作项
 *
 * @param request CreateWorkitemV2Request
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateWorkitemV2Response
 */
async function createWorkitemV2WithOptions(organizationId: string, request: CreateWorkitemV2Request, headers: map[string]string, runtime: Util.RuntimeOptions): CreateWorkitemV2Response {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.assignedTo)) {
    body['assignedTo'] = request.assignedTo;
  }
  if (!Util.isUnset(request.category)) {
    body['category'] = request.category;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.fieldValueList)) {
    body['fieldValueList'] = request.fieldValueList;
  }
  if (!Util.isUnset(request.parentIdentifier)) {
    body['parentIdentifier'] = request.parentIdentifier;
  }
  if (!Util.isUnset(request.participants)) {
    body['participants'] = request.participants;
  }
  if (!Util.isUnset(request.spaceIdentifier)) {
    body['spaceIdentifier'] = request.spaceIdentifier;
  }
  if (!Util.isUnset(request.sprintIdentifier)) {
    body['sprintIdentifier'] = request.sprintIdentifier;
  }
  if (!Util.isUnset(request.subject)) {
    body['subject'] = request.subject;
  }
  if (!Util.isUnset(request.tags)) {
    body['tags'] = request.tags;
  }
  if (!Util.isUnset(request.trackers)) {
    body['trackers'] = request.trackers;
  }
  if (!Util.isUnset(request.verifier)) {
    body['verifier'] = request.verifier;
  }
  if (!Util.isUnset(request.versions)) {
    body['versions'] = request.versions;
  }
  if (!Util.isUnset(request.workitemTypeIdentifier)) {
    body['workitemTypeIdentifier'] = request.workitemTypeIdentifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateWorkitemV2',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitem`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建工作项
 *
 * @param request CreateWorkitemV2Request
 * @return CreateWorkitemV2Response
 */
async function createWorkitemV2(organizationId: string, request: CreateWorkitemV2Request): CreateWorkitemV2Response {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createWorkitemV2WithOptions(organizationId, request, headers, runtime);
}

model DeleteAppMemberRequest {
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199fcd'),
  subjectId?: string(name='subjectId', example='1332695887xxxxxx'),
  subjectType?: string(name='subjectType', example='User'),
}

model DeleteAppMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: string(name='body'),
}

/**
 * @summary 删除应用成员
 *
 * @param request DeleteAppMemberRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAppMemberResponse
 */
async function deleteAppMemberWithOptions(appName: string, request: DeleteAppMemberRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteAppMemberResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.subjectId)) {
    query['subjectId'] = request.subjectId;
  }
  if (!Util.isUnset(request.subjectType)) {
    query['subjectType'] = request.subjectType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAppMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/members`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'string',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除应用成员
 *
 * @param request DeleteAppMemberRequest
 * @return DeleteAppMemberResponse
 */
async function deleteAppMember(appName: string, request: DeleteAppMemberRequest): DeleteAppMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteAppMemberWithOptions(appName, request, headers, runtime);
}

model DeleteBranchRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  branchName?: string(name='branchName', description='This parameter is required.', example='deleteBranch'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='619b80042f595dbd1b9b0de2'),
}

model DeleteBranchResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='6177543A-8D54-5736-A93B-E0195A1512CB'),
  result?: {
    branchName?: string(name='branchName', example='deleteBranch'),
  }(name='result'),
  success?: string(name='success', example='true'),
}

model DeleteBranchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBranchResponseBody(name='body'),
}

/**
 * @summary 删除分支
 *
 * @param request DeleteBranchRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteBranchResponse
 */
async function deleteBranchWithOptions(repositoryId: string, request: DeleteBranchRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteBranchResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.branchName)) {
    query['branchName'] = request.branchName;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteBranch',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/branches/delete`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除分支
 *
 * @param request DeleteBranchRequest
 * @return DeleteBranchResponse
 */
async function deleteBranch(repositoryId: string, request: DeleteBranchRequest): DeleteBranchResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteBranchWithOptions(repositoryId, request, headers, runtime);
}

model DeleteFileRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  branchName?: string(name='branchName', description='This parameter is required.', example='master'),
  commitMessage?: string(name='commitMessage', description='This parameter is required.'),
  filePath?: string(name='filePath', description='This parameter is required.', example='src/main/test.java'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model DeleteFileResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='7EFAD5FB-2296-5D52-BC60-FCC992A40767'),
  result?: {
    branchName?: string(name='branchName', example='master'),
    filePath?: string(name='filePath', example='src/main/delete.java'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model DeleteFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFileResponseBody(name='body'),
}

/**
 * @summary 删除文件
 *
 * @param request DeleteFileRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteFileResponse
 */
async function deleteFileWithOptions(repositoryId: string, request: DeleteFileRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteFileResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.branchName)) {
    query['branchName'] = request.branchName;
  }
  if (!Util.isUnset(request.commitMessage)) {
    query['commitMessage'] = request.commitMessage;
  }
  if (!Util.isUnset(request.filePath)) {
    query['filePath'] = request.filePath;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFile',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/files/delete`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除文件
 *
 * @param request DeleteFileRequest
 * @return DeleteFileResponse
 */
async function deleteFile(repositoryId: string, request: DeleteFileRequest): DeleteFileResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteFileWithOptions(repositoryId, request, headers, runtime);
}

model DeleteFlowTagResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model DeleteFlowTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFlowTagResponseBody(name='body'),
}

/**
 * @summary 删除标签
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteFlowTagResponse
 */
async function deleteFlowTagWithOptions(organizationId: string, id: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteFlowTagResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteFlowTag',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/flow/tags/${OpenApiUtil.getEncodeParam(id)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除标签
 *
 * @return DeleteFlowTagResponse
 */
async function deleteFlowTag(organizationId: string, id: string): DeleteFlowTagResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteFlowTagWithOptions(organizationId, id, headers, runtime);
}

model DeleteFlowTagGroupResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model DeleteFlowTagGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFlowTagGroupResponseBody(name='body'),
}

/**
 * @summary 删除标签分类
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteFlowTagGroupResponse
 */
async function deleteFlowTagGroupWithOptions(organizationId: string, id: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteFlowTagGroupResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteFlowTagGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/flow/tagGroups/${OpenApiUtil.getEncodeParam(id)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除标签分类
 *
 * @return DeleteFlowTagGroupResponse
 */
async function deleteFlowTagGroup(organizationId: string, id: string): DeleteFlowTagGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteFlowTagGroupWithOptions(organizationId, id, headers, runtime);
}

model DeleteGroupMemberRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  aliyunPk?: string(name='aliyunPk', description='This parameter is required.', example='1789095186553536'),
  memberType?: string(name='memberType', description='This parameter is required.', example='USERS'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='6082a9b0c7972588ac363793'),
}

model DeleteGroupMemberResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='SYSTEM_UNKNOWN_ERROR'),
  requestId?: string(name='requestId', example='4D6AF7CC-B43B-5454-86AB-023D25E44868'),
  result?: {
    accessLevel?: int32(name='accessLevel', example='40'),
    avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
    id?: long(name='id', example='524836'),
    memberType?: string(name='memberType', example='USERS'),
    name?: string(name='name', example='codeup'),
    sourceId?: long(name='sourceId', example='2080398'),
    state?: string(name='state', example='active'),
    username?: string(name='username', example='test-codeup'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model DeleteGroupMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteGroupMemberResponseBody(name='body'),
}

/**
 * @summary 删除组成员
 *
 * @param request DeleteGroupMemberRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteGroupMemberResponse
 */
async function deleteGroupMemberWithOptions(groupId: string, request: DeleteGroupMemberRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteGroupMemberResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.aliyunPk)) {
    query['aliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.memberType)) {
    body['memberType'] = request.memberType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteGroupMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/groups/${OpenApiUtil.getEncodeParam(groupId)}/members/remove/aliyun_pk`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除组成员
 *
 * @param request DeleteGroupMemberRequest
 * @return DeleteGroupMemberResponse
 */
async function deleteGroupMember(groupId: string, request: DeleteGroupMemberRequest): DeleteGroupMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteGroupMemberWithOptions(groupId, request, headers, runtime);
}

model DeleteHostGroupResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model DeleteHostGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteHostGroupResponseBody(name='body'),
}

/**
 * @summary 删除主机组
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteHostGroupResponse
 */
async function deleteHostGroupWithOptions(organizationId: string, id: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteHostGroupResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteHostGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/hostGroups/${OpenApiUtil.getEncodeParam(id)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除主机组
 *
 * @return DeleteHostGroupResponse
 */
async function deleteHostGroup(organizationId: string, id: string): DeleteHostGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteHostGroupWithOptions(organizationId, id, headers, runtime);
}

model DeletePipelineResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model DeletePipelineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePipelineResponseBody(name='body'),
}

/**
 * @summary 删除流水线
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePipelineResponse
 */
async function deletePipelineWithOptions(organizationId: string, pipelineId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeletePipelineResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeletePipeline',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除流水线
 *
 * @return DeletePipelineResponse
 */
async function deletePipeline(organizationId: string, pipelineId: string): DeletePipelineResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deletePipelineWithOptions(organizationId, pipelineId, headers, runtime);
}

model DeletePipelineGroupResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model DeletePipelineGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePipelineGroupResponseBody(name='body'),
}

/**
 * @summary 删除流水线分组
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePipelineGroupResponse
 */
async function deletePipelineGroupWithOptions(organizationId: string, groupId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeletePipelineGroupResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeletePipelineGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelineGroups/${OpenApiUtil.getEncodeParam(groupId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除流水线分组
 *
 * @return DeletePipelineGroupResponse
 */
async function deletePipelineGroup(organizationId: string, groupId: string): DeletePipelineGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deletePipelineGroupWithOptions(organizationId, groupId, headers, runtime);
}

model DeletePipelineRelationsRequest {
  relObjectId?: string(name='relObjectId', description='This parameter is required.', example='11'),
  relObjectType?: string(name='relObjectType', description='This parameter is required.', example='VARIABLE_GROUP'),
}

model DeletePipelineRelationsResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model DeletePipelineRelationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePipelineRelationsResponseBody(name='body'),
}

/**
 * @summary 删除流水线关联
 *
 * @param request DeletePipelineRelationsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePipelineRelationsResponse
 */
async function deletePipelineRelationsWithOptions(organizationId: string, pipelineId: string, request: DeletePipelineRelationsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeletePipelineRelationsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.relObjectId)) {
    query['relObjectId'] = request.relObjectId;
  }
  if (!Util.isUnset(request.relObjectType)) {
    query['relObjectType'] = request.relObjectType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePipelineRelations',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/${OpenApiUtil.getEncodeParam(pipelineId)}/pipelineRelations`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除流水线关联
 *
 * @param request DeletePipelineRelationsRequest
 * @return DeletePipelineRelationsResponse
 */
async function deletePipelineRelations(organizationId: string, pipelineId: string, request: DeletePipelineRelationsRequest): DeletePipelineRelationsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deletePipelineRelationsWithOptions(organizationId, pipelineId, request, headers, runtime);
}

model DeleteProjectRequest {
  identifier?: string(name='identifier', description='This parameter is required.', example='7fb72727f32143574f7a...'),
}

model DeleteProjectResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: boolean(name='result', example='true'),
  success?: boolean(name='success', example='true'),
}

model DeleteProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProjectResponseBody(name='body'),
}

/**
 * @summary 删除项目
 *
 * @param request DeleteProjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteProjectResponse
 */
async function deleteProjectWithOptions(organizationId: string, request: DeleteProjectRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProjectResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.identifier)) {
    query['identifier'] = request.identifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteProject',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/projects/delete`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除项目
 *
 * @param request DeleteProjectRequest
 * @return DeleteProjectResponse
 */
async function deleteProject(organizationId: string, request: DeleteProjectRequest): DeleteProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProjectWithOptions(organizationId, request, headers, runtime);
}

model DeleteProjectLabelRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
}

model DeleteProjectLabelResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model DeleteProjectLabelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProjectLabelResponseBody(name='body'),
}

/**
 * @summary 删除代码库Label
 *
 * @param request DeleteProjectLabelRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteProjectLabelResponse
 */
async function deleteProjectLabelWithOptions(labelId: string, request: DeleteProjectLabelRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProjectLabelResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteProjectLabel',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/labels/${OpenApiUtil.getEncodeParam(labelId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除代码库Label
 *
 * @param request DeleteProjectLabelRequest
 * @return DeleteProjectLabelResponse
 */
async function deleteProjectLabel(labelId: string, request: DeleteProjectLabelRequest): DeleteProjectLabelResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProjectLabelWithOptions(labelId, request, headers, runtime);
}

model DeleteProtectedBranchRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='611b75680fc7bf0dbe1dce55'),
}

model DeleteProtectedBranchResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='1F4F342D-493A-5B2C-B133-BA78B30FF834'),
  result?: {
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model DeleteProtectedBranchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProtectedBranchResponseBody(name='body'),
}

/**
 * @summary 删除保护分支
 *
 * @param request DeleteProtectedBranchRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteProtectedBranchResponse
 */
async function deleteProtectedBranchWithOptions(repositoryId: string, protectedBranchId: string, request: DeleteProtectedBranchRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProtectedBranchResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteProtectedBranch',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/protect_branches/${OpenApiUtil.getEncodeParam(protectedBranchId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除保护分支
 *
 * @param request DeleteProtectedBranchRequest
 * @return DeleteProtectedBranchResponse
 */
async function deleteProtectedBranch(repositoryId: string, protectedBranchId: string, request: DeleteProtectedBranchRequest): DeleteProtectedBranchResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProtectedBranchWithOptions(repositoryId, protectedBranchId, request, headers, runtime);
}

model DeletePushRuleRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60d54f3daccf2bbd6659f3ad'),
}

model DeletePushRuleResponseBody = {
  errorCode?: string(name='errorCode', example='InvalidParam.NotFound'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: string(name='success', example='true'),
}

model DeletePushRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePushRuleResponseBody(name='body'),
}

/**
 * @summary 删除推送规则
 *
 * @param request DeletePushRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePushRuleResponse
 */
async function deletePushRuleWithOptions(repositoryId: string, pushRuleId: string, request: DeletePushRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeletePushRuleResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePushRule',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/${OpenApiUtil.getEncodeParam(repositoryId)}/push_rule/${OpenApiUtil.getEncodeParam(pushRuleId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除推送规则
 *
 * @param request DeletePushRuleRequest
 * @return DeletePushRuleResponse
 */
async function deletePushRule(repositoryId: string, pushRuleId: string, request: DeletePushRuleRequest): DeletePushRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deletePushRuleWithOptions(repositoryId, pushRuleId, request, headers, runtime);
}

model DeleteRepositoryRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  reason?: string(name='reason', description='This parameter is required.'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='6082a9b0c7972588ac363793'),
}

model DeleteRepositoryResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='A7586FEB-E48D-5579-983F-74981FBFF627'),
  result?: {
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model DeleteRepositoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRepositoryResponseBody(name='body'),
}

/**
 * @summary 删除代码库
 *
 * @param request DeleteRepositoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRepositoryResponse
 */
async function deleteRepositoryWithOptions(repositoryId: string, request: DeleteRepositoryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteRepositoryResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.reason)) {
    body['reason'] = request.reason;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRepository',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/remove`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除代码库
 *
 * @param request DeleteRepositoryRequest
 * @return DeleteRepositoryResponse
 */
async function deleteRepository(repositoryId: string, request: DeleteRepositoryRequest): DeleteRepositoryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteRepositoryWithOptions(repositoryId, request, headers, runtime);
}

model DeleteRepositoryGroupRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  reason?: string(name='reason', description='This parameter is required.'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='624666bd54d036291ae13a36'),
}

model DeleteRepositoryGroupResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='30F2DA15-2877-5FC9-BC71-F7F394717907'),
  result?: {
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model DeleteRepositoryGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRepositoryGroupResponseBody(name='body'),
}

/**
 * @summary 删除代码组
 *
 * @param request DeleteRepositoryGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRepositoryGroupResponse
 */
async function deleteRepositoryGroupWithOptions(groupId: string, request: DeleteRepositoryGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteRepositoryGroupResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.reason)) {
    body['reason'] = request.reason;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRepositoryGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/groups/${OpenApiUtil.getEncodeParam(groupId)}/remove`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除代码组
 *
 * @param request DeleteRepositoryGroupRequest
 * @return DeleteRepositoryGroupResponse
 */
async function deleteRepositoryGroup(groupId: string, request: DeleteRepositoryGroupRequest): DeleteRepositoryGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteRepositoryGroupWithOptions(groupId, request, headers, runtime);
}

model DeleteRepositoryMemberRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  memberType?: string(name='memberType', example='USERS'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='632bbfdf419338aaa2b1360a'),
}

model DeleteRepositoryMemberResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='0E1BCF81-51E6-59D4-8D55-FF945111127A'),
  result?: {
    accessLevel?: int32(name='accessLevel', example='30'),
    createAt?: string(name='createAt', example='2022-03-12 12:00:00'),
    id?: long(name='id', example='30815'),
    sourceId?: long(name='sourceId', example='2080398'),
    sourceType?: string(name='sourceType', example='Project'),
    updateAt?: string(name='updateAt', example='2022-03-12 12:00:00'),
    userId?: long(name='userId', example='19280'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model DeleteRepositoryMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRepositoryMemberResponseBody(name='body'),
}

/**
 * @summary 删除代码库成员
 *
 * @param request DeleteRepositoryMemberRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRepositoryMemberResponse
 */
async function deleteRepositoryMemberWithOptions(repositoryId: string, aliyunPk: string, request: DeleteRepositoryMemberRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteRepositoryMemberResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.memberType)) {
    body['memberType'] = request.memberType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRepositoryMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/members/delete/${OpenApiUtil.getEncodeParam(aliyunPk)}`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除代码库成员
 *
 * @param request DeleteRepositoryMemberRequest
 * @return DeleteRepositoryMemberResponse
 */
async function deleteRepositoryMember(repositoryId: string, aliyunPk: string, request: DeleteRepositoryMemberRequest): DeleteRepositoryMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteRepositoryMemberWithOptions(repositoryId, aliyunPk, request, headers, runtime);
}

model DeleteRepositoryWebhookRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model DeleteRepositoryWebhookResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: {
    buildEvents?: boolean(name='buildEvents', example='false'),
    createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
    description?: string(name='description'),
    enableSslVerification?: boolean(name='enableSslVerification', example='false'),
    id?: long(name='id', example='524836'),
    issuesEvents?: boolean(name='issuesEvents', example='false'),
    lastTestResult?: string(name='lastTestResult', example='""'),
    mergeRequestsEvents?: boolean(name='mergeRequestsEvents', example='true'),
    noteEvents?: boolean(name='noteEvents', example='true'),
    projectId?: long(name='projectId', example='2369234'),
    pushEvents?: boolean(name='pushEvents', example='true'),
    secretToken?: string(name='secretToken', example='xxxx'),
    tagPushEvents?: boolean(name='tagPushEvents', example='true'),
    type?: string(name='type', example='ProjectHook'),
    url?: string(name='url', example='https://xxxxx'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model DeleteRepositoryWebhookResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRepositoryWebhookResponseBody(name='body'),
}

/**
 * @summary 删除代码库Webhook
 *
 * @param request DeleteRepositoryWebhookRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRepositoryWebhookResponse
 */
async function deleteRepositoryWebhookWithOptions(repositoryId: string, hookId: string, request: DeleteRepositoryWebhookRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteRepositoryWebhookResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRepositoryWebhook',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/hooks/${OpenApiUtil.getEncodeParam(hookId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除代码库Webhook
 *
 * @param request DeleteRepositoryWebhookRequest
 * @return DeleteRepositoryWebhookResponse
 */
async function deleteRepositoryWebhook(repositoryId: string, hookId: string, request: DeleteRepositoryWebhookRequest): DeleteRepositoryWebhookResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteRepositoryWebhookWithOptions(repositoryId, hookId, request, headers, runtime);
}

model DeleteResourceMemberResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model DeleteResourceMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteResourceMemberResponseBody(name='body'),
}

/**
 * @summary 删除资源成员
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteResourceMemberResponse
 */
async function deleteResourceMemberWithOptions(organizationId: string, resourceType: string, resourceId: string, accountId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteResourceMemberResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteResourceMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/${OpenApiUtil.getEncodeParam(resourceType)}/${OpenApiUtil.getEncodeParam(resourceId)}/members/${OpenApiUtil.getEncodeParam(accountId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除资源成员
 *
 * @return DeleteResourceMemberResponse
 */
async function deleteResourceMember(organizationId: string, resourceType: string, resourceId: string, accountId: string): DeleteResourceMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteResourceMemberWithOptions(organizationId, resourceType, resourceId, accountId, headers, runtime);
}

model DeleteTagRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='609633ffd40eb063bac8165a'),
  tagName?: string(name='tagName', description='This parameter is required.', example='v1.0'),
}

model DeleteTagResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='60945D4F-CF6D-5CFF-89ED-1D1F6657032C'),
  result?: {
    tagName?: string(name='tagName', example='v1.0'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model DeleteTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTagResponseBody(name='body'),
}

/**
 * @summary 删除标签
 *
 * @param request DeleteTagRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTagResponse
 */
async function deleteTagWithOptions(repositoryId: string, request: DeleteTagRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteTagResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.tagName)) {
    query['tagName'] = request.tagName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTag',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/tags/delete`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除标签
 *
 * @param request DeleteTagRequest
 * @return DeleteTagResponse
 */
async function deleteTag(repositoryId: string, request: DeleteTagRequest): DeleteTagResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteTagWithOptions(repositoryId, request, headers, runtime);
}

model DeleteUserKeyRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
}

model DeleteUserKeyResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='SYSTEM_UNKNOWN_ERROR'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    context?: string(name='context', example='xxx'),
    createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
    expireTime?: string(name='expireTime', example='2022-03-18 14:24:54'),
    fingerPrint?: string(name='fingerPrint', example='xxx'),
    id?: long(name='id', example='50998'),
    keyScope?: string(name='keyScope', example='ALL'),
    lastUsedTime?: string(name='lastUsedTime', example='2022-03-18 14:24:54'),
    publicKey?: string(name='publicKey', example='xxx'),
    shaContext?: string(name='shaContext', example='xxx'),
    title?: string(name='title'),
    updatedAt?: string(name='updatedAt', example='2022-03-18 14:24:54'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model DeleteUserKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteUserKeyResponseBody(name='body'),
}

/**
 * @summary 删除用户的SSH Key
 *
 * @param request DeleteUserKeyRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteUserKeyResponse
 */
async function deleteUserKeyWithOptions(keyId: string, request: DeleteUserKeyRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteUserKeyResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUserKey',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v3/user/keys/${OpenApiUtil.getEncodeParam(keyId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除用户的SSH Key
 *
 * @param request DeleteUserKeyRequest
 * @return DeleteUserKeyResponse
 */
async function deleteUserKey(keyId: string, request: DeleteUserKeyRequest): DeleteUserKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteUserKeyWithOptions(keyId, request, headers, runtime);
}

model DeleteVariableGroupResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model DeleteVariableGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteVariableGroupResponseBody(name='body'),
}

/**
 * @summary 删除变量组
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteVariableGroupResponse
 */
async function deleteVariableGroupWithOptions(organizationId: string, id: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteVariableGroupResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteVariableGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/variableGroups/${OpenApiUtil.getEncodeParam(id)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除变量组
 *
 * @return DeleteVariableGroupResponse
 */
async function deleteVariableGroup(organizationId: string, id: string): DeleteVariableGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteVariableGroupWithOptions(organizationId, id, headers, runtime);
}

model DeleteWorkitemRequest {
  identifier?: string(name='identifier', description='This parameter is required.', example='3ef2ef6018d254d660e65f87a6'),
}

model DeleteWorkitemResponseBody = {
  deleteFlag?: boolean(name='deleteFlag', example='true/false'),
  errorCode?: string(name='errorCode', example='InvalidTagGroup.IdNotFound'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', description='Id of the request', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', description='true/false', example='true'),
}

model DeleteWorkitemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteWorkitemResponseBody(name='body'),
}

/**
 * @summary 删除工作项
 *
 * @param request DeleteWorkitemRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteWorkitemResponse
 */
async function deleteWorkitemWithOptions(organizationId: string, request: DeleteWorkitemRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteWorkitemResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.identifier)) {
    query['identifier'] = request.identifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteWorkitem',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitem/delete`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除工作项
 *
 * @param request DeleteWorkitemRequest
 * @return DeleteWorkitemResponse
 */
async function deleteWorkitem(organizationId: string, request: DeleteWorkitemRequest): DeleteWorkitemResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteWorkitemWithOptions(organizationId, request, headers, runtime);
}

model DeleteWorkitemAllCommentRequest {
  identifier?: string(name='identifier', description='This parameter is required.', example='deafe5f33xxxxx6a259d8dafd'),
}

model DeleteWorkitemAllCommentResponseBody = {
  deleteFlag?: boolean(name='deleteFlag', example='true/false'),
  errorCode?: string(name='errorCode', example='success'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', description='Id of the request', example='A7586FEB-E48D-5579-983F-74981FBFF627'),
  success?: string(name='success', example='true'),
}

model DeleteWorkitemAllCommentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteWorkitemAllCommentResponseBody(name='body'),
}

/**
 * @summary 删除所有评论
 *
 * @param request DeleteWorkitemAllCommentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteWorkitemAllCommentResponse
 */
async function deleteWorkitemAllCommentWithOptions(organizationId: string, request: DeleteWorkitemAllCommentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteWorkitemAllCommentResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.identifier)) {
    query['identifier'] = request.identifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteWorkitemAllComment',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/deleteAllComment`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除所有评论
 *
 * @param request DeleteWorkitemAllCommentRequest
 * @return DeleteWorkitemAllCommentResponse
 */
async function deleteWorkitemAllComment(organizationId: string, request: DeleteWorkitemAllCommentRequest): DeleteWorkitemAllCommentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteWorkitemAllCommentWithOptions(organizationId, request, headers, runtime);
}

model DeleteWorkitemCommentRequest {
  commentId?: long(name='commentId', description='This parameter is required.', example='12xx34'),
  identifier?: string(name='identifier', description='This parameter is required.', example='e8b2xxxxxx2abdxxxxxxxx23'),
}

model DeleteWorkitemCommentResponseBody = {
  deleteFlag?: boolean(name='deleteFlag', example='true/false'),
  errorCode?: string(name='errorCode', example='success'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', description='Id of the request', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: string(name='success', example='true'),
}

model DeleteWorkitemCommentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteWorkitemCommentResponseBody(name='body'),
}

/**
 * @summary 删除单条评论
 *
 * @param request DeleteWorkitemCommentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteWorkitemCommentResponse
 */
async function deleteWorkitemCommentWithOptions(organizationId: string, request: DeleteWorkitemCommentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteWorkitemCommentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.commentId)) {
    body['commentId'] = request.commentId;
  }
  if (!Util.isUnset(request.identifier)) {
    body['identifier'] = request.identifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteWorkitemComment',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/deleteComent`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除单条评论
 *
 * @param request DeleteWorkitemCommentRequest
 * @return DeleteWorkitemCommentResponse
 */
async function deleteWorkitemComment(organizationId: string, request: DeleteWorkitemCommentRequest): DeleteWorkitemCommentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteWorkitemCommentWithOptions(organizationId, request, headers, runtime);
}

model EnableDeployKeyRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model EnableDeployKeyResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model EnableDeployKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableDeployKeyResponseBody(name='body'),
}

/**
 * @summary 启用部署密钥
 *
 * @param request EnableDeployKeyRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableDeployKeyResponse
 */
async function enableDeployKeyWithOptions(repositoryId: string, keyId: string, request: EnableDeployKeyRequest, headers: map[string]string, runtime: Util.RuntimeOptions): EnableDeployKeyResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableDeployKey',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/keys/${OpenApiUtil.getEncodeParam(keyId)}/enable`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 启用部署密钥
 *
 * @param request EnableDeployKeyRequest
 * @return EnableDeployKeyResponse
 */
async function enableDeployKey(repositoryId: string, keyId: string, request: EnableDeployKeyRequest): EnableDeployKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return enableDeployKeyWithOptions(repositoryId, keyId, request, headers, runtime);
}

model ExecuteChangeRequestReleaseStageRequest {
  params?: map[string]any(name='params'),
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199fcd'),
}

model ExecuteChangeRequestReleaseStageResponseBody = {
  object?: long(name='object', example='1'),
  pipelineId?: long(name='pipelineId', example='3259***'),
  pipelineRunId?: long(name='pipelineRunId', example='1'),
}

model ExecuteChangeRequestReleaseStageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteChangeRequestReleaseStageResponseBody(name='body'),
}

/**
 * @summary 执行研发阶段流水线
 *
 * @param request ExecuteChangeRequestReleaseStageRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteChangeRequestReleaseStageResponse
 */
async function executeChangeRequestReleaseStageWithOptions(appName: string, releaseWorkflowSn: string, releaseStageSn: string, request: ExecuteChangeRequestReleaseStageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteChangeRequestReleaseStageResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.params)) {
    body['params'] = request.params;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteChangeRequestReleaseStage',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/releaseWorkflows/${OpenApiUtil.getEncodeParam(releaseWorkflowSn)}/releaseStages/${OpenApiUtil.getEncodeParam(releaseStageSn)}%3Aexecute`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 执行研发阶段流水线
 *
 * @param request ExecuteChangeRequestReleaseStageRequest
 * @return ExecuteChangeRequestReleaseStageResponse
 */
async function executeChangeRequestReleaseStage(appName: string, releaseWorkflowSn: string, releaseStageSn: string, request: ExecuteChangeRequestReleaseStageRequest): ExecuteChangeRequestReleaseStageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeChangeRequestReleaseStageWithOptions(appName, releaseWorkflowSn, releaseStageSn, request, headers, runtime);
}

model ExportInsightCustomValueRequest {
  endTime?: string(name='endTime', description='This parameter is required.', example='2024-06-01 00:00:00'),
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='1'),
  startTime?: string(name='startTime', description='This parameter is required.', example='2024-05-01 00:00:00'),
}

model ExportInsightCustomValueResponseBody = {
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='2'),
  result?: [ 
    {
      doubleValue?: double(name='doubleValue', example='66.6'),
      fieldId?: string(name='fieldId', example='34dde3dfa5e3750151a7c4xxxx'),
      gmtCreate?: long(name='gmtCreate', example='1704950971000'),
      gmtModified?: long(name='gmtModified', example='1714669494000'),
      id?: long(name='id', example='320737507'),
      identifier?: string(name='identifier', example='442d4a6a9980e841dc192a411080xxxx'),
      isDeleted?: string(name='isDeleted', example='N'),
      longValue?: long(name='longValue', example='66'),
      organizationId?: string(name='organizationId', example='61db9af2148974246bexxxx'),
      targetId?: string(name='targetId', example='1ee00fcb1a18c2dc83dafdxxxx'),
      targetType?: string(name='targetType', example='Workitem'),
      type?: string(name='type', example='string'),
      value?: string(name='value', example='66'),
    }
  ](name='result'),
  totalCount?: long(name='totalCount', example='100'),
}

model ExportInsightCustomValueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportInsightCustomValueResponseBody(name='body'),
}

/**
 * @summary 导出Insight custom_value表
 *
 * @param request ExportInsightCustomValueRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportInsightCustomValueResponse
 */
async function exportInsightCustomValueWithOptions(organizationId: string, request: ExportInsightCustomValueRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExportInsightCustomValueResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExportInsightCustomValue',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/data/customValues`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 导出Insight custom_value表
 *
 * @param request ExportInsightCustomValueRequest
 * @return ExportInsightCustomValueResponse
 */
async function exportInsightCustomValue(organizationId: string, request: ExportInsightCustomValueRequest): ExportInsightCustomValueResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return exportInsightCustomValueWithOptions(organizationId, request, headers, runtime);
}

model ExportInsightExpectedWorkTimeRequest {
  endTime?: string(name='endTime', description='This parameter is required.', example='2024-06-01 00:00:00'),
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='1'),
  startTime?: string(name='startTime', description='This parameter is required.', example='2024-05-01 00:00:00'),
}

model ExportInsightExpectedWorkTimeResponseBody = {
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='2'),
  result?: [ 
    {
      gmtCreate?: long(name='gmtCreate', example='1714976497000'),
      gmtModified?: long(name='gmtModified', example='1714976520000'),
      id?: long(name='id', example='26281535'),
      identifier?: string(name='identifier', example='bd4ddc7b0ea0ef2ab52699xxxx'),
      isDeleted?: string(name='isDeleted', example='N'),
      organizationId?: string(name='organizationId', example='61db9af2148974246be6xxxx'),
      projectId?: string(name='projectId', example='6c4687b0179e1d458fedf1xxxx'),
      recorderId?: string(name='recorderId', example='63466a385dc8531eebd7xxxx'),
      source?: string(name='source', example='projex'),
      type?: string(name='type'),
      value?: double(name='value', example='180'),
      workitemId?: string(name='workitemId', example='de7c6fd3bd4b53f4d9e279xxxx'),
    }
  ](name='result'),
  totalCount?: long(name='totalCount', example='100'),
}

model ExportInsightExpectedWorkTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportInsightExpectedWorkTimeResponseBody(name='body'),
}

/**
 * @summary 导出Insight expected_work_time表数据
 *
 * @param request ExportInsightExpectedWorkTimeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportInsightExpectedWorkTimeResponse
 */
async function exportInsightExpectedWorkTimeWithOptions(organizationId: string, request: ExportInsightExpectedWorkTimeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExportInsightExpectedWorkTimeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExportInsightExpectedWorkTime',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/data/expectedWorkTimes`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 导出Insight expected_work_time表数据
 *
 * @param request ExportInsightExpectedWorkTimeRequest
 * @return ExportInsightExpectedWorkTimeResponse
 */
async function exportInsightExpectedWorkTime(organizationId: string, request: ExportInsightExpectedWorkTimeRequest): ExportInsightExpectedWorkTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return exportInsightExpectedWorkTimeWithOptions(organizationId, request, headers, runtime);
}

model ExportInsightFieldRequest {
  endTime?: string(name='endTime', description='This parameter is required.', example='2024-06-01 00:00:00'),
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='1'),
  startTime?: string(name='startTime', description='This parameter is required.', example='2024-05-01 00:00:00'),
}

model ExportInsightFieldResponseBody = {
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='2'),
  result?: [ 
    {
      fieldId?: string(name='fieldId', example='9798551'),
      fieldName?: string(name='fieldName'),
      gmtCreate?: long(name='gmtCreate', example='1713752162000'),
      gmtModified?: long(name='gmtModified', example='1714977502000'),
      id?: long(name='id', example='666666'),
      identifier?: string(name='identifier', example='field-444153'),
      isDeleted?: string(name='isDeleted', example='N'),
      isSystem?: string(name='isSystem', example='N'),
      optionValue?: string(name='optionValue'),
      organizationId?: string(name='organizationId', example='61db9af2148974246bexxxx'),
      position?: int32(name='position', example='150'),
      scope?: string(name='scope', example='global'),
      source?: string(name='source', example='projex'),
      targetId?: string(name='targetId', example='61db9af2148974246bexxxx'),
      targetType?: string(name='targetType', example='organization'),
      type?: string(name='type', example='string'),
    }
  ](name='result'),
  totalCount?: long(name='totalCount', example='100'),
}

model ExportInsightFieldResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportInsightFieldResponseBody(name='body'),
}

/**
 * @summary 导出Insight field表
 *
 * @param request ExportInsightFieldRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportInsightFieldResponse
 */
async function exportInsightFieldWithOptions(organizationId: string, request: ExportInsightFieldRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExportInsightFieldResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExportInsightField',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/data/fields`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 导出Insight field表
 *
 * @param request ExportInsightFieldRequest
 * @return ExportInsightFieldResponse
 */
async function exportInsightField(organizationId: string, request: ExportInsightFieldRequest): ExportInsightFieldResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return exportInsightFieldWithOptions(organizationId, request, headers, runtime);
}

model ExportInsightSpaceRequest {
  endTime?: string(name='endTime', description='This parameter is required.', example='2024-06-01 00:00:00'),
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='1'),
  startTime?: string(name='startTime', description='This parameter is required.', example='2024-05-01 00:00:00'),
}

model ExportInsightSpaceResponseBody = {
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='2'),
  result?: [ 
    {
      category?: string(name='category', example='Project'),
      customCode?: string(name='customCode'),
      description?: string(name='description'),
      gmtCreate?: long(name='gmtCreate', example='1706510424000'),
      gmtModified?: long(name='gmtModified', example='1706511201000'),
      id?: long(name='id', example='11034222'),
      identifier?: string(name='identifier', example='83a2861bbb43b270a04b42xxxx'),
      isDeleted?: string(name='isDeleted', example='N'),
      name?: string(name='name'),
      organizationId?: string(name='organizationId', example='61db9af2148974246be6xxxx'),
      source?: string(name='source', example='projex'),
      stage?: string(name='stage', example='10'),
      status?: string(name='status'),
      type?: string(name='type', example='Project'),
    }
  ](name='result'),
  totalCount?: long(name='totalCount', example='100'),
}

model ExportInsightSpaceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportInsightSpaceResponseBody(name='body'),
}

/**
 * @summary 导出Insight space表数据
 *
 * @param request ExportInsightSpaceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportInsightSpaceResponse
 */
async function exportInsightSpaceWithOptions(organizationId: string, request: ExportInsightSpaceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExportInsightSpaceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExportInsightSpace',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/data/spaces`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 导出Insight space表数据
 *
 * @param request ExportInsightSpaceRequest
 * @return ExportInsightSpaceResponse
 */
async function exportInsightSpace(organizationId: string, request: ExportInsightSpaceRequest): ExportInsightSpaceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return exportInsightSpaceWithOptions(organizationId, request, headers, runtime);
}

model ExportInsightSpaceRefRequest {
  endTime?: string(name='endTime', description='This parameter is required.', example='2024-06-01 00:00:00'),
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='1'),
  startTime?: string(name='startTime', description='This parameter is required.', example='2024-05-01 00:00:00'),
}

model ExportInsightSpaceRefResponseBody = {
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='2'),
  result?: [ 
    {
      creatorId?: string(name='creatorId', example='65659358c319d2a0f912xxxx'),
      fromId?: string(name='fromId', example='7bc2be989727d0d4c9801fxxxx'),
      gmtCreate?: long(name='gmtCreate', example='1704267849000'),
      gmtModified?: long(name='gmtModified', example='1704267849000'),
      id?: long(name='id', example='356525'),
      identifier?: string(name='identifier', example='49565'),
      isDeleted?: string(name='isDeleted', example='N'),
      modifierId?: string(name='modifierId', example='65659358c319d2a0f912xxxx'),
      organizationId?: string(name='organizationId', example='61db9af2148974246bexxxx'),
      toId?: string(name='toId', example='732026500a48d7a74f8b43xxxx'),
      type?: string(name='type', example='ASSOCIATED'),
    }
  ](name='result'),
  totalCount?: long(name='totalCount', example='100'),
}

model ExportInsightSpaceRefResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportInsightSpaceRefResponseBody(name='body'),
}

/**
 * @summary 导出Insight space_ref表数据
 *
 * @param request ExportInsightSpaceRefRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportInsightSpaceRefResponse
 */
async function exportInsightSpaceRefWithOptions(organizationId: string, request: ExportInsightSpaceRefRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExportInsightSpaceRefResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExportInsightSpaceRef',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/data/spaceRefs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 导出Insight space_ref表数据
 *
 * @param request ExportInsightSpaceRefRequest
 * @return ExportInsightSpaceRefResponse
 */
async function exportInsightSpaceRef(organizationId: string, request: ExportInsightSpaceRefRequest): ExportInsightSpaceRefResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return exportInsightSpaceRefWithOptions(organizationId, request, headers, runtime);
}

model ExportInsightSprintRequest {
  endTime?: string(name='endTime', description='This parameter is required.', example='2024-06-01 00:00:00'),
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='1'),
  startTime?: string(name='startTime', description='This parameter is required.', example='2024-05-01 00:00:00'),
}

model ExportInsightSprintResponseBody = {
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='2'),
  result?: [ 
    {
      actualEnd?: long(name='actualEnd', example='1711936113000'),
      actualStart?: long(name='actualStart', example='1711936113000'),
      gmtCreate?: long(name='gmtCreate', example='1710989643000'),
      gmtEnd?: long(name='gmtEnd', example='1711728000000'),
      gmtModified?: long(name='gmtModified', example='1711936113000'),
      gmtStart?: long(name='gmtStart', example='1711936113000'),
      id?: long(name='id', example='18471761'),
      identifier?: string(name='identifier', example='e4895cadc86632f34dfaa7xxxx'),
      isDeleted?: string(name='isDeleted', example='N'),
      name?: string(name='name'),
      organizationId?: string(name='organizationId', example='61db9af2148974246bexxxx'),
      projectId?: string(name='projectId', example='385e7e5a4be6791f0a5185xxxx'),
      source?: string(name='source', example='projex'),
      status?: int32(name='status', example='50'),
      workTimeCapacity?: double(name='workTimeCapacity', example='60.0'),
    }
  ](name='result'),
  totalCount?: long(name='totalCount', example='100'),
}

model ExportInsightSprintResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportInsightSprintResponseBody(name='body'),
}

/**
 * @summary 导出Insight sprint表数据
 *
 * @param request ExportInsightSprintRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportInsightSprintResponse
 */
async function exportInsightSprintWithOptions(organizationId: string, request: ExportInsightSprintRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExportInsightSprintResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExportInsightSprint',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/data/sprints`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 导出Insight sprint表数据
 *
 * @param request ExportInsightSprintRequest
 * @return ExportInsightSprintResponse
 */
async function exportInsightSprint(organizationId: string, request: ExportInsightSprintRequest): ExportInsightSprintResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return exportInsightSprintWithOptions(organizationId, request, headers, runtime);
}

model ExportInsightTagRefRequest {
  endTime?: string(name='endTime', description='This parameter is required.', example='2024-06-01 00:00:00'),
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='1'),
  startTime?: string(name='startTime', description='This parameter is required.', example='2024-05-01 00:00:00'),
}

model ExportInsightTagRefResponseBody = {
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='2'),
  result?: [ 
    {
      gmtCreate?: long(name='gmtCreate', example='1696660187000'),
      gmtModified?: long(name='gmtModified', example='1696660187000'),
      id?: long(name='id', example='41317426'),
      identifier?: string(name='identifier', example='8545272'),
      isDeleted?: string(name='isDeleted', example='N'),
      name?: string(name='name', example='1'),
      organizationId?: string(name='organizationId', example='61db9af2148974246bexxxx'),
      tagId?: string(name='tagId', example='19e0bc5348ccbe6c0d00fbxxxx'),
      targetId?: string(name='targetId', example='bde89961b5a4acc8cf54eaxxxx'),
      targetType?: string(name='targetType', example='Workitem'),
    }
  ](name='result'),
  totalCount?: long(name='totalCount', example='100'),
}

model ExportInsightTagRefResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportInsightTagRefResponseBody(name='body'),
}

/**
 * @summary 导出Insight tag_ref表数据
 *
 * @param request ExportInsightTagRefRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportInsightTagRefResponse
 */
async function exportInsightTagRefWithOptions(organizationId: string, request: ExportInsightTagRefRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExportInsightTagRefResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExportInsightTagRef',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/data/tagRefs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 导出Insight tag_ref表数据
 *
 * @param request ExportInsightTagRefRequest
 * @return ExportInsightTagRefResponse
 */
async function exportInsightTagRef(organizationId: string, request: ExportInsightTagRefRequest): ExportInsightTagRefResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return exportInsightTagRefWithOptions(organizationId, request, headers, runtime);
}

model ExportInsightWorkTimeRequest {
  endTime?: string(name='endTime', description='This parameter is required.', example='2024-06-01 00:00:00'),
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='1'),
  startTime?: string(name='startTime', description='This parameter is required.', example='2024-05-01 00:00:00'),
}

model ExportInsightWorkTimeResponseBody = {
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='2'),
  result?: [ 
    {
      actualValue?: double(name='actualValue', example='120'),
      description?: string(name='description'),
      gmtCreate?: long(name='gmtCreate', example='1714978610000'),
      gmtEnd?: long(name='gmtEnd', example='1715011199999'),
      gmtModified?: long(name='gmtModified', example='1714978610000'),
      gmtStart?: long(name='gmtStart', example='1714924800000'),
      id?: long(name='id', example='49506082'),
      identifier?: string(name='identifier', example='da70ce5824231ca3c04ef808e0'),
      isDeleted?: string(name='isDeleted', example='N'),
      organizationId?: string(name='organizationId', example='61db9af2148974246bexxxx'),
      projectId?: string(name='projectId', example='09670872890eb1a0bb998exxxx'),
      recorderId?: string(name='recorderId', example='65659358c319d2a0f912xxxx'),
      source?: string(name='source', example='projex'),
      type?: string(name='type'),
      uuid?: string(name='uuid', example='000000000cd82d3df50d5e5a5c094094fd7b4461'),
      value?: long(name='value', example='120'),
      workitemId?: string(name='workitemId', example='17bc1cf9a037a15fc9ce76xxxx'),
    }
  ](name='result'),
  totalCount?: long(name='totalCount', example='100'),
}

model ExportInsightWorkTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportInsightWorkTimeResponseBody(name='body'),
}

/**
 * @summary 导出Insight work_time表数据
 *
 * @param request ExportInsightWorkTimeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportInsightWorkTimeResponse
 */
async function exportInsightWorkTimeWithOptions(organizationId: string, request: ExportInsightWorkTimeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExportInsightWorkTimeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExportInsightWorkTime',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/data/workTimes`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 导出Insight work_time表数据
 *
 * @param request ExportInsightWorkTimeRequest
 * @return ExportInsightWorkTimeResponse
 */
async function exportInsightWorkTime(organizationId: string, request: ExportInsightWorkTimeRequest): ExportInsightWorkTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return exportInsightWorkTimeWithOptions(organizationId, request, headers, runtime);
}

model ExportInsightWorkitemStatusRequest {
  endTime?: string(name='endTime', description='This parameter is required.', example='2024-06-01 00:00:00'),
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='1'),
  startTime?: string(name='startTime', description='This parameter is required.', example='2024-05-01 00:00:00'),
}

model ExportInsightWorkitemStatusResponseBody = {
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='2'),
  result?: [ 
    {
      assignedToId?: string(name='assignedToId', example='65e836b981d758be7a25xxxx'),
      creatorId?: string(name='creatorId', example='65e836b981d758be7a25xxxx'),
      expectedWorkTime?: long(name='expectedWorkTime', example='10'),
      gmtClosed?: long(name='gmtClosed', example='33166339200000'),
      gmtCreate?: long(name='gmtCreate', example='1713430241000'),
      gmtDue?: long(name='gmtDue', example='33166339200000'),
      gmtModified?: long(name='gmtModified', example='1713430241000'),
      gmtStart?: long(name='gmtStart', example='33166339200000'),
      gmtTodo?: long(name='gmtTodo', example='33166339200000'),
      id?: long(name='id', example='701615370'),
      isArchived?: string(name='isArchived', example='N'),
      isDeleted?: string(name='isDeleted', example='N'),
      isDone?: string(name='isDone', example='Y'),
      organizationId?: string(name='organizationId', example='61db9af2148974246bexxxx'),
      parentId?: string(name='parentId', example='c3640ab6233fcc10a7e3aaxxxx'),
      participantIds?: string(name='participantIds', example='6135b21fb383ef39551cxxxx,63466a385dc8531eebd7xxxx'),
      phase?: int32(name='phase', example='10'),
      priority?: int32(name='priority', example='0'),
      productId?: string(name='productId'),
      projectId?: string(name='projectId', example='505ac6433dfbda8df0b08bxxxx'),
      serialNumber?: int32(name='serialNumber'),
      source?: string(name='source', example='projex'),
      sprintId?: string(name='sprintId', example='505ac6433dfbda8df0b08bxxxx'),
      stage?: int32(name='stage', example='10'),
      status?: string(name='status'),
      statusId?: string(name='statusId', example='100005'),
      storyPoint?: float(name='storyPoint', example='10.0'),
      subType?: string(name='subType', example='9uy29901re573f561d69xxxx'),
      subject?: string(name='subject'),
      type?: int32(name='type', example='1'),
      versionId?: string(name='versionId'),
      versions?: string(name='versions', example='[6a8cdda167415bea1506c7262c]'),
      workTime?: long(name='workTime', example='10'),
      workitemId?: string(name='workitemId', example='636f661a612a945bbcdb4cxxxx'),
    }
  ](name='result'),
  totalCount?: long(name='totalCount', example='100'),
}

model ExportInsightWorkitemStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportInsightWorkitemStatusResponseBody(name='body'),
}

/**
 * @summary 导出Insight workitem_stauts表数据
 *
 * @param request ExportInsightWorkitemStatusRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportInsightWorkitemStatusResponse
 */
async function exportInsightWorkitemStatusWithOptions(organizationId: string, request: ExportInsightWorkitemStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExportInsightWorkitemStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExportInsightWorkitemStatus',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/data/workitemStatuses`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 导出Insight workitem_stauts表数据
 *
 * @param request ExportInsightWorkitemStatusRequest
 * @return ExportInsightWorkitemStatusResponse
 */
async function exportInsightWorkitemStatus(organizationId: string, request: ExportInsightWorkitemStatusRequest): ExportInsightWorkitemStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return exportInsightWorkitemStatusWithOptions(organizationId, request, headers, runtime);
}

model ExportInsightWorkitemStatusJoinWorkitemDefectExtraRequest {
  endTime?: string(name='endTime', description='This parameter is required.', example='2024-06-01 00:00:00'),
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='1'),
  startTime?: string(name='startTime', description='This parameter is required.', example='2024-05-01 00:00:00'),
}

model ExportInsightWorkitemStatusJoinWorkitemDefectExtraResponseBody = {
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='2'),
  result?: [ 
    {
      assignedToId?: string(name='assignedToId', example='65e836b981d758be7a25xxxx'),
      creatorId?: string(name='creatorId', example='65e836b981d758be7a25xxxx'),
      expectedWorkTime?: long(name='expectedWorkTime', example='10'),
      extraId?: long(name='extraId', example='123'),
      extraIsDeleted?: string(name='extraIsDeleted', example='N'),
      foundPhase?: int32(name='foundPhase', example='10'),
      gmtClosed?: long(name='gmtClosed', example='33166339200000'),
      gmtCreate?: long(name='gmtCreate', example='1713430241000'),
      gmtDue?: long(name='gmtDue', example='33166339200000'),
      gmtFixed?: string(name='gmtFixed'),
      gmtModified?: long(name='gmtModified', example='1714755985000'),
      gmtStart?: long(name='gmtStart', example='33166339200000'),
      gmtTodo?: long(name='gmtTodo', example='33166339200000'),
      id?: long(name='id', example='701615370'),
      isArchived?: string(name='isArchived', example='N'),
      isDeleted?: string(name='isDeleted', example='N'),
      isDone?: string(name='isDone', example='Y'),
      isStupid?: string(name='isStupid'),
      organizationId?: string(name='organizationId', example='61db9af2148974246bexxxx'),
      parentId?: string(name='parentId', example='a80a203a9078a7a1b1f2c6xxxx'),
      participantIds?: string(name='participantIds', example='6135b21fb383ef39551cf02e,63466a385dc8531eebd764e9'),
      phase?: int32(name='phase', example='10'),
      priority?: int32(name='priority', example='2'),
      productId?: string(name='productId'),
      projectId?: string(name='projectId', example='6732a29d846bf998dc09e7xxxx'),
      reopenNum?: int32(name='reopenNum'),
      serialNumber?: int32(name='serialNumber'),
      seriousLevel?: int32(name='seriousLevel'),
      solution?: string(name='solution'),
      source?: string(name='source', example='projex'),
      sprintId?: string(name='sprintId', example='731c83a40bbf3c2f080e07xxxx'),
      stage?: int32(name='stage', example='10'),
      status?: string(name='status'),
      statusId?: string(name='statusId', example='100005'),
      storyPoint?: float(name='storyPoint', example='10.0'),
      subType?: string(name='subType', example='9uy29901re573f561d69xxxx'),
      subject?: string(name='subject'),
      type?: int32(name='type', example='1'),
      verifierId?: string(name='verifierId', example='65e836b981d758be7a25xxxx'),
      versionId?: string(name='versionId'),
      versions?: string(name='versions', example='{6a8cdda167415bea1506c7262c}'),
      workTime?: long(name='workTime', example='10'),
      workitemId?: string(name='workitemId', example='636f661a612a945bbcdb4cxxxx'),
    }
  ](name='result'),
  totalCount?: long(name='totalCount', example='100'),
}

model ExportInsightWorkitemStatusJoinWorkitemDefectExtraResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportInsightWorkitemStatusJoinWorkitemDefectExtraResponseBody(name='body'),
}

/**
 * @summary 导出Insight workitem_stauts表 join workitem_defect_extra表表数据
 *
 * @param request ExportInsightWorkitemStatusJoinWorkitemDefectExtraRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportInsightWorkitemStatusJoinWorkitemDefectExtraResponse
 */
async function exportInsightWorkitemStatusJoinWorkitemDefectExtraWithOptions(organizationId: string, request: ExportInsightWorkitemStatusJoinWorkitemDefectExtraRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExportInsightWorkitemStatusJoinWorkitemDefectExtraResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExportInsightWorkitemStatusJoinWorkitemDefectExtra',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/data/workitemStatusJoinWorkitemDefectExtras`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 导出Insight workitem_stauts表 join workitem_defect_extra表表数据
 *
 * @param request ExportInsightWorkitemStatusJoinWorkitemDefectExtraRequest
 * @return ExportInsightWorkitemStatusJoinWorkitemDefectExtraResponse
 */
async function exportInsightWorkitemStatusJoinWorkitemDefectExtra(organizationId: string, request: ExportInsightWorkitemStatusJoinWorkitemDefectExtraRequest): ExportInsightWorkitemStatusJoinWorkitemDefectExtraResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return exportInsightWorkitemStatusJoinWorkitemDefectExtraWithOptions(organizationId, request, headers, runtime);
}

model ExportInsightWorkitemVersionRequest {
  endTime?: string(name='endTime', description='This parameter is required.', example='2024-06-01 00:00:00'),
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='1'),
  startTime?: string(name='startTime', description='This parameter is required.', example='2024-05-01 00:00:00'),
}

model ExportInsightWorkitemVersionResponseBody = {
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='2'),
  result?: [ 
    {
      gmtCreate?: long(name='gmtCreate', example='1704251228000'),
      gmtModified?: long(name='gmtModified', example='1704251228000'),
      gmtPublish?: long(name='gmtPublish', example='1704902400000'),
      gmtStart?: long(name='gmtStart', example='1704297600000'),
      id?: long(name='id', example='648131'),
      identifier?: string(name='identifier', example='7ba6e8261b973c976df76b7de1'),
      isDeleted?: string(name='isDeleted', example='N'),
      lockStatus?: int32(name='lockStatus', example='0'),
      name?: string(name='name'),
      organizationId?: string(name='organizationId', example='61db9af2148974246bexxxx'),
      source?: string(name='source', example='projex'),
      status?: int32(name='status', example='100'),
      targetId?: string(name='targetId', example='7eee44ec7f699d4e6980faxxxx'),
      targetType?: string(name='targetType', example='Project'),
    }
  ](name='result'),
  totalCount?: long(name='totalCount', example='100'),
}

model ExportInsightWorkitemVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportInsightWorkitemVersionResponseBody(name='body'),
}

/**
 * @summary 导出Insight workitem_version表数据
 *
 * @param request ExportInsightWorkitemVersionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportInsightWorkitemVersionResponse
 */
async function exportInsightWorkitemVersionWithOptions(organizationId: string, request: ExportInsightWorkitemVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExportInsightWorkitemVersionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExportInsightWorkitemVersion',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/data/workitemVersions`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 导出Insight workitem_version表数据
 *
 * @param request ExportInsightWorkitemVersionRequest
 * @return ExportInsightWorkitemVersionResponse
 */
async function exportInsightWorkitemVersion(organizationId: string, request: ExportInsightWorkitemVersionRequest): ExportInsightWorkitemVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return exportInsightWorkitemVersionWithOptions(organizationId, request, headers, runtime);
}

model ExportWorkitemActivityRequest {
  endTime?: string(name='endTime', description='This parameter is required.', example='2024-06-01 00:00:00'),
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='1'),
  startTime?: string(name='startTime', description='This parameter is required.', example='2024-05-01 00:00:00'),
}

model ExportWorkitemActivityResponseBody = {
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='2'),
  result?: [ 
    {
      gmtEvent?: long(name='gmtEvent', example='1714961337000'),
      id?: long(name='id', example='4406380356'),
      identifier?: string(name='identifier', example='254662353'),
      newValue?: string(name='newValue', example='1'),
      oldValue?: string(name='oldValue', example='2'),
      organizationId?: string(name='organizationId', example='61db9af2148974246bexxxx'),
      projectId?: string(name='projectId', example='2a62349afcbef7f23d8f31xxxx'),
      source?: string(name='source', example='projex'),
      type?: string(name='type', example='workitem.update.priority'),
      workitemId?: string(name='workitemId', example='ec69eae498acce08ff7260xxxx'),
    }
  ](name='result'),
  totalCount?: long(name='totalCount', example='100'),
}

model ExportWorkitemActivityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportWorkitemActivityResponseBody(name='body'),
}

/**
 * @summary 导出Insight workitem_activity表数据
 *
 * @param request ExportWorkitemActivityRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportWorkitemActivityResponse
 */
async function exportWorkitemActivityWithOptions(organizationId: string, request: ExportWorkitemActivityRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExportWorkitemActivityResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExportWorkitemActivity',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/data/workitemActivities`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 导出Insight workitem_activity表数据
 *
 * @param request ExportWorkitemActivityRequest
 * @return ExportWorkitemActivityResponse
 */
async function exportWorkitemActivity(organizationId: string, request: ExportWorkitemActivityRequest): ExportWorkitemActivityResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return exportWorkitemActivityWithOptions(organizationId, request, headers, runtime);
}

model GetApplicationRequest {
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199fcd'),
}

model GetApplicationResponseBody = {
  appTemplateDisplayName?: string(name='appTemplateDisplayName', example='应用模版展示名称A'),
  appTemplateName?: string(name='appTemplateName', example='应用模版名称A'),
  creatorAccountId?: string(name='creatorAccountId', example='1332695887xxxxxx'),
  description?: string(name='description', example='应用描述'),
  gmtCreate?: string(name='gmtCreate', example='2024-01-01T00:00:00.000+00:00'),
  name?: string(name='name', example='testApp'),
  requestId?: string(name='requestId', example='FC93CE1A-8D7A-13A9-8306-7465DE2E5C0F'),
}

model GetApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetApplicationResponseBody(name='body'),
}

/**
 * @summary 查找应用详情
 *
 * @param request GetApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetApplicationResponse
 */
async function getApplicationWithOptions(appName: string, request: GetApplicationRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetApplicationResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetApplication',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查找应用详情
 *
 * @param request GetApplicationRequest
 * @return GetApplicationResponse
 */
async function getApplication(appName: string, request: GetApplicationRequest): GetApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getApplicationWithOptions(appName, request, headers, runtime);
}

model GetBranchInfoRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  branchName?: string(name='branchName', description='This parameter is required.', example='master'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5fbe3118672533690be72b12'),
}

model GetBranchInfoResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='6177543A-8D54-5736-A93B-E0195A1512CB'),
  result?: {
    commit?: {
      author?: {
        avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
        email?: string(name='email', example='username@example.com'),
        id?: long(name='id', example='28056'),
        name?: string(name='name', example='codeup-test'),
        state?: string(name='state', example='active'),
        username?: string(name='username', example='testtest'),
      }(name='author'),
      authorEmail?: string(name='authorEmail', example='username@example.com'),
      authorName?: string(name='authorName'),
      authoredDate?: string(name='authoredDate', example='2022-03-18 08:00:00'),
      commentsCount?: long(name='commentsCount', example='0'),
      committedDate?: string(name='committedDate', example='2022-03-18 09:00:00'),
      committer?: {
        avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
        email?: string(name='email', example='username@example.com'),
        id?: long(name='id', example='5035'),
        name?: string(name='name', example='codeup-commit'),
        state?: string(name='state', example='active'),
        username?: string(name='username', example='commitcommit'),
      }(name='committer'),
      committerEmail?: string(name='committerEmail', example='username@example.com'),
      committerName?: string(name='committerName'),
      createdAt?: string(name='createdAt', example='2022-03-18 10:00:00'),
      id?: string(name='id', example='e0297d8fb0393c833a8531e7cc8832739e3cba6d'),
      message?: string(name='message'),
      parentIds?: [ string ](name='parentIds'),
      shortId?: string(name='shortId', example='e0297d8f'),
      signature?: {
        gpgKeyId?: string(name='gpgKeyId', example='""'),
        verificationStatus?: string(name='verificationStatus', example='verified'),
      }(name='signature'),
      title?: string(name='title'),
    }(name='commit'),
    name?: string(name='name', example='master'),
    protected?: string(name='protected', example='false'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetBranchInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetBranchInfoResponseBody(name='body'),
}

/**
 * @summary 查询单个分支
 *
 * @param request GetBranchInfoRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetBranchInfoResponse
 */
async function getBranchInfoWithOptions(repositoryId: string, request: GetBranchInfoRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetBranchInfoResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.branchName)) {
    query['branchName'] = request.branchName;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBranchInfo',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/branches/detail`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询单个分支
 *
 * @param request GetBranchInfoRequest
 * @return GetBranchInfoResponse
 */
async function getBranchInfo(repositoryId: string, request: GetBranchInfoRequest): GetBranchInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getBranchInfoWithOptions(repositoryId, request, headers, runtime);
}

model GetCheckRunRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  checkRunId?: long(name='checkRunId', description='This parameter is required.', example='1'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
}

model GetCheckRunResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    annotations?: [ 
      {
        annotationLevel?: string(name='annotationLevel', example='warning'),
        endColumn?: long(name='endColumn', example='4'),
        endLine?: long(name='endLine', example='2'),
        id?: long(name='id', example='1'),
        message?: string(name='message'),
        path?: string(name='path', example='demo/test.txt'),
        rawDetails?: string(name='rawDetails'),
        startColumn?: long(name='startColumn', example='3'),
        startLine?: long(name='startLine', example='1'),
        title?: string(name='title'),
      }
    ](name='annotations'),
    checkSuite?: {
      id?: long(name='id', example='1'),
    }(name='checkSuite'),
    completedAt?: string(name='completedAt', example='2023-03-15T08:00:00Z'),
    conclusion?: string(name='conclusion', example='success'),
    createdAt?: string(name='createdAt', example='2022-01-14T21:08:26+08:00'),
    detailsUrl?: string(name='detailsUrl', example='xxx'),
    externalId?: string(name='externalId', example='42'),
    headSha?: string(name='headSha', example='40f4ccfe019cdd4a62d4acb0c57130106fc7e1be'),
    id?: long(name='id', example='5240'),
    name?: string(name='name', example='my-check-ci'),
    output?: {
      images?: [ 
        {
          alt?: string(name='alt', example='test-image-alt'),
          caption?: string(name='caption', example='test'),
          imageUrl?: string(name='imageUrl', example='xxx'),
        }
      ](name='images'),
      summary?: string(name='summary'),
      text?: string(name='text'),
      title?: string(name='title', example='Mighty Readme report'),
    }(name='output'),
    startedAt?: string(name='startedAt', example='2023-03-15T08:00:00Z'),
    status?: string(name='status', example='completed'),
    updatedAt?: string(name='updatedAt', example='2022-01-14T21:08:26+08:00'),
    writer?: {
      id?: string(name='id', example='xxx'),
      logoUrl?: string(name='logoUrl', example='xxx'),
      name?: string(name='name', example='test-codeup'),
      slug?: string(name='slug', example='test-codeup'),
      type?: string(name='type', example='User'),
    }(name='writer'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetCheckRunResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCheckRunResponseBody(name='body'),
}

/**
 * @summary 查询检查运行
 *
 * @param request GetCheckRunRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCheckRunResponse
 */
async function getCheckRunWithOptions(request: GetCheckRunRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetCheckRunResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.checkRunId)) {
    query['checkRunId'] = request.checkRunId;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCheckRun',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/check_runs/get_check_run`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询检查运行
 *
 * @param request GetCheckRunRequest
 * @return GetCheckRunResponse
 */
async function getCheckRun(request: GetCheckRunRequest): GetCheckRunResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getCheckRunWithOptions(request, headers, runtime);
}

model GetCodeupOrganizationRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
}

model GetCodeupOrganizationResponseBody = {
  errorCode?: string(name='errorCode', example='InvalidTagGroup.IdNotFound'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    createdAt?: string(name='createdAt', example='2022-03-12 12:00:00'),
    id?: long(name='id', example='3624'),
    namespaceId?: long(name='namespaceId', example='100003'),
    organizationId?: string(name='organizationId', example='60de7a6852743a5162b5f957'),
    path?: string(name='path', example='test-codeup'),
    updatedAt?: string(name='updatedAt', example='2022-03-18 14:24:54'),
    userRole?: string(name='userRole', example='ORG_MEMBER'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetCodeupOrganizationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCodeupOrganizationResponseBody(name='body'),
}

/**
 * @summary 获取企业信息
 *
 * @param request GetCodeupOrganizationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCodeupOrganizationResponse
 */
async function getCodeupOrganizationWithOptions(identity: string, request: GetCodeupOrganizationRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetCodeupOrganizationResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCodeupOrganization',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/organization/${OpenApiUtil.getEncodeParam(identity)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取企业信息
 *
 * @param request GetCodeupOrganizationRequest
 * @return GetCodeupOrganizationResponse
 */
async function getCodeupOrganization(identity: string, request: GetCodeupOrganizationRequest): GetCodeupOrganizationResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getCodeupOrganizationWithOptions(identity, request, headers, runtime);
}

model GetCompareDetailRequest {
  from?: string(name='from', description='This parameter is required.', example='c9fb781f3d66ef6ee60bdd5c414f5106454b1426'),
  maxDiffByte?: int32(name='maxDiffByte', example='24 * 1024 * 1024'),
  maxDiffFile?: int32(name='maxDiffFile', example='5000'),
  mergeBase?: boolean(name='mergeBase', example='false'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  to?: string(name='to', description='This parameter is required.', example='b8f6f28520b1936aafe2e638373e19ccafa42b02'),
}

model GetCompareDetailResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    commits?: [ 
      {
        author?: {
          avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
          email?: string(name='email', example='username@example.com'),
          id?: long(name='id', example='21396'),
          name?: string(name='name'),
          state?: string(name='state', example='active'),
          username?: string(name='username', example='Codeup'),
        }(name='author'),
        authorEmail?: string(name='authorEmail', example='username@example.com'),
        authorName?: string(name='authorName'),
        authoredDate?: string(name='authoredDate', example='2023-01-03T15:41:26+08:00'),
        commentsCount?: long(name='commentsCount', example='1'),
        committedDate?: string(name='committedDate', example='2023-01-03T15:41:26+08:00'),
        committer?: {
          avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
          email?: string(name='email', example='username@example.com'),
          id?: long(name='id', example='43910'),
          name?: string(name='name'),
          state?: string(name='state', example='active'),
          username?: string(name='username', example='Codeup-commiter'),
        }(name='committer'),
        committerEmail?: string(name='committerEmail', example='username@example.com'),
        committerName?: string(name='committerName'),
        createdAt?: string(name='createdAt', example='2023-01-03T15:41:26+08:00'),
        id?: string(name='id', example='b8f6f28520b1936aafe2e638373e19ccafa42b02'),
        message?: string(name='message', example='""'),
        parentIds?: [ string ](name='parentIds'),
        shortId?: string(name='shortId', example='b8f6f285'),
        title?: string(name='title'),
      }
    ](name='commits'),
    diffs?: [ 
      {
        aMode?: string(name='aMode', example='100644'),
        bMode?: string(name='bMode', example='100644'),
        deletedFile?: boolean(name='deletedFile', example='false'),
        diff?: string(name='diff'),
        isBinary?: boolean(name='isBinary', example='false'),
        isNewLfs?: boolean(name='isNewLfs', example='false'),
        isOldLfs?: boolean(name='isOldLfs', example='false'),
        newFile?: boolean(name='newFile', example='false'),
        newId?: string(name='newId', example='cb75846da2df3d3d7f290c3569236fcf3dd17224'),
        newPath?: string(name='newPath', example='new_test.txt'),
        oldId?: string(name='oldId', example='6c268061a546378276559c713d0ad377d4dsjfh'),
        oldPath?: string(name='oldPath', example='test.txt'),
        renamedFile?: boolean(name='renamedFile', example='false'),
      }
    ](name='diffs'),
    messages?: [ string ](name='messages'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetCompareDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCompareDetailResponseBody(name='body'),
}

/**
 * @summary 获取比较详情
 *
 * @param request GetCompareDetailRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCompareDetailResponse
 */
async function getCompareDetailWithOptions(repositoryId: string, request: GetCompareDetailRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetCompareDetailResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.from)) {
    query['from'] = request.from;
  }
  if (!Util.isUnset(request.maxDiffByte)) {
    query['maxDiffByte'] = request.maxDiffByte;
  }
  if (!Util.isUnset(request.maxDiffFile)) {
    query['maxDiffFile'] = request.maxDiffFile;
  }
  if (!Util.isUnset(request.mergeBase)) {
    query['mergeBase'] = request.mergeBase;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.to)) {
    query['to'] = request.to;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCompareDetail',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/commits/compare/detail`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取比较详情
 *
 * @param request GetCompareDetailRequest
 * @return GetCompareDetailResponse
 */
async function getCompareDetail(repositoryId: string, request: GetCompareDetailRequest): GetCompareDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getCompareDetailWithOptions(repositoryId, request, headers, runtime);
}

model GetCustomFieldOptionRequest {
  spaceIdentifier?: string(name='spaceIdentifier', description='This parameter is required.', example='e8bxxxxxxxxxxxxxxxx23'),
  spaceType?: string(name='spaceType', description='This parameter is required.', example='Project'),
  workitemTypeIdentifier?: string(name='workitemTypeIdentifier', description='This parameter is required.', example='9uyxxxx1re573f561dxxxxx'),
}

model GetCustomFieldOptionResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  fileds?: [ 
    {
      displayValue?: string(name='displayValue', example='223'),
      fieldIdentifier?: string(name='fieldIdentifier', example='e8bxxxxxxxxxxxxxxxx23'),
      identifier?: string(name='identifier', example='3345'),
      level?: long(name='level', example='1'),
      position?: long(name='position', example='1'),
      value?: string(name='value', example='223'),
      valueEn?: string(name='valueEn', example='223'),
    }
  ](name='fileds'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model GetCustomFieldOptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCustomFieldOptionResponseBody(name='body'),
}

/**
 * @summary 获取自定义字段的选项值
 *
 * @param request GetCustomFieldOptionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCustomFieldOptionResponse
 */
async function getCustomFieldOptionWithOptions(organizationId: string, fieldId: string, request: GetCustomFieldOptionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetCustomFieldOptionResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.spaceIdentifier)) {
    query['spaceIdentifier'] = request.spaceIdentifier;
  }
  if (!Util.isUnset(request.spaceType)) {
    query['spaceType'] = request.spaceType;
  }
  if (!Util.isUnset(request.workitemTypeIdentifier)) {
    query['workitemTypeIdentifier'] = request.workitemTypeIdentifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCustomFieldOption',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/fields/${OpenApiUtil.getEncodeParam(fieldId)}/getCustomOption`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取自定义字段的选项值
 *
 * @param request GetCustomFieldOptionRequest
 * @return GetCustomFieldOptionResponse
 */
async function getCustomFieldOption(organizationId: string, fieldId: string, request: GetCustomFieldOptionRequest): GetCustomFieldOptionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getCustomFieldOptionWithOptions(organizationId, fieldId, request, headers, runtime);
}

model GetFileBlobsRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  filePath?: string(name='filePath', description='This parameter is required.', example='src/Test.java'),
  from?: long(name='from', example='10'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
  ref?: string(name='ref', description='This parameter is required.', example='master  / tag1.0 /  ecykhdd'),
  to?: long(name='to', example='10'),
}

model GetFileBlobsResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='F590C9D8-E908-5B6C-95AC-56B7E8011FFA'),
  result?: {
    content?: string(name='content', example='xxxx'),
    size?: long(name='size'),
    totalLines?: int32(name='totalLines', example='65535'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetFileBlobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetFileBlobsResponseBody(name='body'),
}

/**
 * @summary 查询文件
 *
 * @param request GetFileBlobsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetFileBlobsResponse
 */
async function getFileBlobsWithOptions(repositoryId: string, request: GetFileBlobsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetFileBlobsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.filePath)) {
    query['filePath'] = request.filePath;
  }
  if (!Util.isUnset(request.from)) {
    query['from'] = request.from;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.ref)) {
    query['ref'] = request.ref;
  }
  if (!Util.isUnset(request.to)) {
    query['to'] = request.to;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFileBlobs',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/files/blobs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询文件
 *
 * @param request GetFileBlobsRequest
 * @return GetFileBlobsResponse
 */
async function getFileBlobs(repositoryId: string, request: GetFileBlobsRequest): GetFileBlobsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getFileBlobsWithOptions(repositoryId, request, headers, runtime);
}

model GetFileLastCommitRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  filePath?: string(name='filePath', description='This parameter is required.', example='src/main/test.java'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
  sha?: string(name='sha', description='This parameter is required.', example='master'),
  showSignature?: boolean(name='showSignature', example='false'),
}

model GetFileLastCommitResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: {
    authorDate?: string(name='authorDate', example='2022-08-08 18:09:09'),
    authorEmail?: string(name='authorEmail', example='username@example.com'),
    authorName?: string(name='authorName', example='test-codeup'),
    committedDate?: string(name='committedDate', example='2022-03-18 15:00:02'),
    committerEmail?: string(name='committerEmail', example='username@example.com'),
    committerName?: string(name='committerName', example='committer-codeup'),
    createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
    id?: string(name='id', example='ff4fb5ac6d1f44f452654336d2dba468ae6c8d04'),
    message?: string(name='message'),
    parentIds?: [ string ](name='parentIds'),
    shortId?: string(name='shortId', example='ff4fb5ac'),
    signature?: {
      gpgKeyId?: string(name='gpgKeyId', description='GPG密钥ID', example='34d2c47c7ce46a5c4639c5ffe208'),
      verificationStatus?: string(name='verificationStatus', example='verified'),
    }(name='signature'),
    title?: string(name='title'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetFileLastCommitResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetFileLastCommitResponseBody(name='body'),
}

/**
 * @summary 获取文件上一次提交信息
 *
 * @param request GetFileLastCommitRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetFileLastCommitResponse
 */
async function getFileLastCommitWithOptions(repositoryId: string, request: GetFileLastCommitRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetFileLastCommitResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.filePath)) {
    query['filePath'] = request.filePath;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.sha)) {
    query['sha'] = request.sha;
  }
  if (!Util.isUnset(request.showSignature)) {
    query['showSignature'] = request.showSignature;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFileLastCommit',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/files/lastCommit`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取文件上一次提交信息
 *
 * @param request GetFileLastCommitRequest
 * @return GetFileLastCommitResponse
 */
async function getFileLastCommit(repositoryId: string, request: GetFileLastCommitRequest): GetFileLastCommitResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getFileLastCommitWithOptions(repositoryId, request, headers, runtime);
}

model GetFlowTagGroupResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  flowTagGroup?: {
    creatorAccountId?: string(name='creatorAccountId', example='1111111111111'),
    flowTagList?: [ 
      {
        color?: string(name='color', example='#1F9AEF'),
        creatorAccountId?: string(name='creatorAccountId', example='1111111111111'),
        id?: long(name='id', example='111'),
        modiferAccountId?: string(name='modiferAccountId', example='1111111111111'),
        name?: string(name='name'),
      }
    ](name='flowTagList'),
    id?: long(name='id', example='1111'),
    modiferAccountId?: string(name='modiferAccountId', example='1111111111111'),
    name?: string(name='name'),
  }(name='flowTagGroup'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model GetFlowTagGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetFlowTagGroupResponseBody(name='body'),
}

/**
 * @summary 获取标签分类
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetFlowTagGroupResponse
 */
async function getFlowTagGroupWithOptions(organizationId: string, id: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetFlowTagGroupResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetFlowTagGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/flow/tagGroups/${OpenApiUtil.getEncodeParam(id)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取标签分类
 *
 * @return GetFlowTagGroupResponse
 */
async function getFlowTagGroup(organizationId: string, id: string): GetFlowTagGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getFlowTagGroupWithOptions(organizationId, id, headers, runtime);
}

model GetGroupByPathRequest {
  identity?: string(name='identity', description='This parameter is required.', example='60de7a6852743a5162b5f957/test-group'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model GetGroupByPathResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='6177543A-8D54-5736-A93B-E0195A1512CB'),
  result?: {
    avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
    description?: string(name='description'),
    id?: long(name='id', example='30815'),
    name?: string(name='name', example='test-group'),
    nameWithNamespace?: string(name='nameWithNamespace'),
    ownerId?: string(name='ownerId', example='19230'),
    parentId?: string(name='parentId', example='26842'),
    path?: string(name='path', example='test-group'),
    pathWithNamespace?: string(name='pathWithNamespace', example='codeup-test-org/test-group'),
    visibilityLevel?: int32(name='visibilityLevel', example='0'),
    webUrl?: string(name='webUrl', example='xxx'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetGroupByPathResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetGroupByPathResponseBody(name='body'),
}

/**
 * @summary 根据路径查询代码组
 *
 * @param request GetGroupByPathRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetGroupByPathResponse
 */
async function getGroupByPathWithOptions(request: GetGroupByPathRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetGroupByPathResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.identity)) {
    query['identity'] = request.identity;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetGroupByPath',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/4/groups/find_by_path`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 根据路径查询代码组
 *
 * @param request GetGroupByPathRequest
 * @return GetGroupByPathResponse
 */
async function getGroupByPath(request: GetGroupByPathRequest): GetGroupByPathResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getGroupByPathWithOptions(request, headers, runtime);
}

model GetGroupDetailRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  groupId?: long(name='groupId', description='This parameter is required.', example='36612'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='6218766746d4d2ca636d0497'),
}

model GetGroupDetailResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='4CA06B0B-5867-5DE6-A0FA-9F39C97B524C'),
  result?: {
    avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
    description?: string(name='description'),
    id?: long(name='id', example='36612'),
    name?: string(name='name', example='test-group-detail'),
    nameWithNamespace?: string(name='nameWithNamespace'),
    ownerId?: long(name='ownerId', example='19230'),
    parentId?: long(name='parentId', example='26842'),
    path?: string(name='path', example='test-group-detail'),
    pathWithNamespace?: string(name='pathWithNamespace', example='codeup-test-org/test-group-detail'),
    type?: string(name='type', example='Group'),
    visibilityLevel?: int32(name='visibilityLevel', example='10'),
    webUrl?: string(name='webUrl', example='""'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetGroupDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetGroupDetailResponseBody(name='body'),
}

/**
 * @summary 查询代码组信息
 *
 * @param request GetGroupDetailRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetGroupDetailResponse
 */
async function getGroupDetailWithOptions(request: GetGroupDetailRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetGroupDetailResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.groupId)) {
    query['groupId'] = request.groupId;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetGroupDetail',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/groups/get_detail`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询代码组信息
 *
 * @param request GetGroupDetailRequest
 * @return GetGroupDetailResponse
 */
async function getGroupDetail(request: GetGroupDetailRequest): GetGroupDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getGroupDetailWithOptions(request, headers, runtime);
}

model GetHostGroupResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  hostGroup?: {
    aliyunRegion?: string(name='aliyunRegion', example='cn-bejing'),
    createTime?: long(name='createTime', example='1586863220000'),
    creatorAccountId?: string(name='creatorAccountId', example='111111'),
    description?: string(name='description'),
    ecsLabelKey?: string(name='ecsLabelKey', example='ecs'),
    ecsLabelValue?: string(name='ecsLabelValue', example='ecs'),
    ecsType?: string(name='ecsType', example='ECS_ALIYUN'),
    hostInfos?: [ 
      {
        aliyunRegionId?: string(name='aliyunRegionId', example='cn-hangzhou'),
        createTime?: long(name='createTime', example='1586863220000'),
        creatorAccountId?: string(name='creatorAccountId', example='11111'),
        instanceName?: string(name='instanceName', example='ceshi'),
        ip?: string(name='ip', example='127.0.0.1'),
        machineSn?: string(name='machineSn', example='1ssasa'),
        modifierAccountId?: string(name='modifierAccountId', example='11111111111'),
        objectType?: string(name='objectType', example='MachineInfo'),
        updateTime?: long(name='updateTime', example='1586863220000'),
      }
    ](name='hostInfos'),
    hostNum?: long(name='hostNum', example='1'),
    id?: long(name='id', example='1234'),
    modifierAccountId?: string(name='modifierAccountId', example='11111'),
    name?: string(name='name'),
    serviceConnectionId?: long(name='serviceConnectionId', example='1234'),
    type?: string(name='type', example='ECS'),
    upateTIme?: long(name='upateTIme', example='1586863220000'),
  }(name='hostGroup'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model GetHostGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHostGroupResponseBody(name='body'),
}

/**
 * @summary 获取主机组信息
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHostGroupResponse
 */
async function getHostGroupWithOptions(organizationId: string, id: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetHostGroupResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetHostGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/hostGroups/${OpenApiUtil.getEncodeParam(id)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取主机组信息
 *
 * @return GetHostGroupResponse
 */
async function getHostGroup(organizationId: string, id: string): GetHostGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getHostGroupWithOptions(organizationId, id, headers, runtime);
}

model GetMergeRequestRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
}

model GetMergeRequestResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: {
    ahead?: int32(name='ahead', example='1'),
    allRequirementsPass?: boolean(name='allRequirementsPass', example='true'),
    author?: {
      avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
      email?: string(name='email', example='username@example.com'),
      id?: long(name='id', example='19927'),
      name?: string(name='name', example='test-codeup'),
      state?: string(name='state', example='active'),
      username?: string(name='username', example='root-test-codeup'),
    }(name='author'),
    behind?: int32(name='behind', example='1'),
    createFrom?: string(name='createFrom', example='WEB'),
    createTime?: string(name='createTime', example='2023-05-30T02:53:36Z'),
    description?: string(name='description'),
    detailUrl?: string(name='detailUrl', example='xxx'),
    localId?: long(name='localId', example='1'),
    mergedRevision?: string(name='mergedRevision'),
    mrBizId?: string(name='mrBizId', example='bca90244c4b749e0b109df52ac0eb570'),
    mrType?: string(name='mrType', example='CODE_REVIEW'),
    projectId?: long(name='projectId', example='2369234'),
    reviewers?: [ 
      {
        avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
        email?: string(name='email', example='username@example.com'),
        hasCommented?: boolean(name='hasCommented'),
        hasReviewed?: boolean(name='hasReviewed', example='false'),
        id?: long(name='id', example='90452'),
        name?: string(name='name', example='test-codeup'),
        reviewOpinionStatus?: string(name='reviewOpinionStatus', example='NOT_PASS'),
        reviewTime?: string(name='reviewTime'),
        state?: string(name='state', example='active'),
        username?: string(name='username', example='root-test-codeup'),
      }
    ](name='reviewers'),
    sourceBranch?: string(name='sourceBranch', example='test-merge-request'),
    sourceProjectId?: long(name='sourceProjectId', example='2369234'),
    status?: string(name='status', example='UNDER_REVIEW'),
    subscribers?: [ 
      {
        avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
        email?: string(name='email', example='username@example.com'),
        id?: long(name='id', example='90452'),
        name?: string(name='name', example='test-subscriber'),
        state?: string(name='state', example='active'),
        username?: string(name='username', example='test-subscriber'),
      }
    ](name='subscribers'),
    supportMergeFastForwardOnly?: boolean(name='supportMergeFastForwardOnly', example='true'),
    targetBranch?: string(name='targetBranch', example='master'),
    targetProjectId?: long(name='targetProjectId', example='2369234'),
    targetProjectNameWithNamespace?: string(name='targetProjectNameWithNamespace'),
    targetProjectPathWithNamespace?: string(name='targetProjectPathWithNamespace', example='orgId/test-group/test-target-repo'),
    title?: string(name='title'),
    todoList?: {
      requirementCheckItems?: [ 
        {
          itemType?: string(name='itemType', example='COMMENTS_CHECK'),
          pass?: boolean(name='pass', example='true'),
        }
      ](name='requirementCheckItems'),
    }(name='todoList'),
    updateTime?: string(name='updateTime', example='2023-05-30T02:53:36Z'),
    webUrl?: string(name='webUrl', example='xxx'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetMergeRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMergeRequestResponseBody(name='body'),
}

/**
 * @summary 查询合并请求详情
 *
 * @param request GetMergeRequestRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMergeRequestResponse
 */
async function getMergeRequestWithOptions(repositoryId: string, localId: string, request: GetMergeRequestRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetMergeRequestResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetMergeRequest',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/${OpenApiUtil.getEncodeParam(repositoryId)}/merge_requests/${OpenApiUtil.getEncodeParam(localId)}/detail`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询合并请求详情
 *
 * @param request GetMergeRequestRequest
 * @return GetMergeRequestResponse
 */
async function getMergeRequest(repositoryId: string, localId: string, request: GetMergeRequestRequest): GetMergeRequestResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getMergeRequestWithOptions(repositoryId, localId, request, headers, runtime);
}

model GetMergeRequestChangeTreeRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  fromPatchSetBizId?: string(name='fromPatchSetBizId', description='This parameter is required.', example='5e733626d53f4b04a6aa0e23d4ff72b8'),
  localId?: long(name='localId', description='This parameter is required.', example='7'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
  toPatchSetBizId?: string(name='toPatchSetBizId', description='This parameter is required.', example='513fcfd81a9142d2bb0db4f72c0aa15b'),
}

model GetMergeRequestChangeTreeResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='HC93CE1A-8D7A-13A9-8306-7465DE2E5C0F'),
  result?: {
    changedFilesCount?: long(name='changedFilesCount', example='20'),
    changedFilesInfos?: [ 
      {
        addLines?: long(name='addLines', example='10'),
        binaryFile?: boolean(name='binaryFile', example='false'),
        delLines?: long(name='delLines', example='0'),
        deletedFile?: boolean(name='deletedFile', example='false'),
        newFile?: boolean(name='newFile', example='true'),
        newPath?: string(name='newPath', example='test.txt'),
        oldPath?: string(name='oldPath', example='test.txt'),
        renamedFile?: boolean(name='renamedFile', example='false'),
      }
    ](name='changedFilesInfos'),
    totalAddLines?: long(name='totalAddLines', example='100'),
    totalDelLines?: long(name='totalDelLines', example='50'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetMergeRequestChangeTreeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMergeRequestChangeTreeResponseBody(name='body'),
}

/**
 * @summary 查询合并请求的变更信息
 *
 * @param request GetMergeRequestChangeTreeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMergeRequestChangeTreeResponse
 */
async function getMergeRequestChangeTreeWithOptions(request: GetMergeRequestChangeTreeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetMergeRequestChangeTreeResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.fromPatchSetBizId)) {
    query['fromPatchSetBizId'] = request.fromPatchSetBizId;
  }
  if (!Util.isUnset(request.localId)) {
    query['localId'] = request.localId;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }
  if (!Util.isUnset(request.toPatchSetBizId)) {
    query['toPatchSetBizId'] = request.toPatchSetBizId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetMergeRequestChangeTree',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/merge_requests/diffs/change_tree`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询合并请求的变更信息
 *
 * @param request GetMergeRequestChangeTreeRequest
 * @return GetMergeRequestChangeTreeResponse
 */
async function getMergeRequestChangeTree(request: GetMergeRequestChangeTreeRequest): GetMergeRequestChangeTreeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getMergeRequestChangeTreeWithOptions(request, headers, runtime);
}

model GetOrganizationMemberResponseBody = {
  errorCode?: string(name='errorCode', example='null'),
  errorMessage?: string(name='errorMessage', example='error info'),
  member?: {
    accountId?: string(name='accountId', example='123456677888'),
    birthday?: long(name='birthday', example='1631845101798'),
    deptLists?: [ string ](name='deptLists'),
    email?: string(name='email', example='(敏感字段，暂不返回)'),
    hiredDate?: long(name='hiredDate', example='1631845101798'),
    identities?: {
      externUid?: string(name='externUid', example='1236666'),
      provider?: string(name='provider', example='Dingtalk'),
    }(name='identities'),
    jobNumber?: string(name='jobNumber', example='373***'),
    joinTime?: long(name='joinTime', example='1631845101798'),
    lastVisitTime?: long(name='lastVisitTime', example='1631845101798'),
    mobile?: string(name='mobile', example='(敏感字段，暂不返回)'),
    organizationMemberName?: string(name='organizationMemberName'),
    organizationRoleId?: string(name='organizationRoleId', example='8fc0c9ff039711dd64acd000'),
    organizationRoleName?: string(name='organizationRoleName'),
    state?: string(name='state', example='normal'),
  }(name='member'),
  requestId?: string(name='requestId', example='HC93CE1A-8D7A-13A9-8306-7465DE2E5C0F'),
  success?: boolean(name='success', example='true'),
}

model GetOrganizationMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetOrganizationMemberResponseBody(name='body'),
}

/**
 * @summary 获取企业成员
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetOrganizationMemberResponse
 */
async function getOrganizationMemberWithOptions(organizationId: string, accountId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetOrganizationMemberResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetOrganizationMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/members/${OpenApiUtil.getEncodeParam(accountId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取企业成员
 *
 * @return GetOrganizationMemberResponse
 */
async function getOrganizationMember(organizationId: string, accountId: string): GetOrganizationMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getOrganizationMemberWithOptions(organizationId, accountId, headers, runtime);
}

model GetPipelineResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  pipeline?: {
    createTime?: long(name='createTime', example='1586863220000'),
    creatorAccountId?: string(name='creatorAccountId', example='112222122'),
    envId?: int32(name='envId', example='0'),
    envName?: string(name='envName', example='日常环境'),
    groupId?: long(name='groupId', example='1111'),
    modifierAccountId?: string(name='modifierAccountId', example='112222122'),
    name?: string(name='name', example='流水线'),
    pipelineConfig?: {
      flow?: string(name='flow', example='schema: tb pipeline:   - name: 执行命令     stages:       - driven: AUTO         jobs:           - displayName: 执行命令             task: execution-component-production@10             identifier: \\"10_1626147407245\\"             templateType: task             templateSign: \\"\\"             templateBatchUpdate: \\"N\\"             extraInfo: \\"\\"             params:               version1: pre-jdk1.62               steps:                 - name: 执行命令                   stepType: exec-shell                   stepIdentifier: \\"10_1626147407245__11_1626147407249\\"                   command: |                     # input your command here                     echo hello,world!                   ARTIFACTS: \\"\\"                   JSONEncoding: true                   freeInTaskGroupModeFields:                     - ARTIFACTS                   source: 132504-sss_ddd_3mvJ               ENGINE_PIPELINE_NAME: \\"${INPUTS.ENGINE_PIPELINE_NAME}\\"               ENGINE_PIPELINE_ID: \\"${INPUTS.ENGINE_PIPELINE_ID}\\"               ENGINE_PIPELINE_INST_ID: \\"${INPUTS.ENGINE_PIPELINE_INST_ID}\\"               ENGINE_PIPELINE_INST_NUMBER: \\"${INPUTS.ENGINE_PIPELINE_INST_NUMBER}\\"               buildNodeGroup: K8S-4             plugins: []             output: []             freeInTaskGroupModeFields: []'),
      settings?: string(name='settings', example='{}'),
      sources?: [ 
        {
          data?: {
            branch?: string(name='branch', example='master'),
            cloneDepth?: long(name='cloneDepth', example='1'),
            credentialId?: long(name='credentialId', description='Credential Id', example='222'),
            credentialLabel?: string(name='credentialLabel', description='Credential Label', example='企业公钥'),
            credentialType?: string(name='credentialType', description='Credential Type', example='region-ssh'),
            events?: [ string ](name='events'),
            isBranchMode?: boolean(name='isBranchMode', example='false'),
            isCloneDepth?: boolean(name='isCloneDepth', example='true'),
            isSubmodule?: boolean(name='isSubmodule', example='false'),
            isTrigger?: boolean(name='isTrigger', example='true'),
            label?: string(name='label', example='cdup/ss'),
            namespace?: string(name='namespace', example='asasasas'),
            repo?: string(name='repo', example='https://codeup.aliyun.com/test.git'),
            serviceConnectionId?: long(name='serviceConnectionId', example='12'),
            triggerFilter?: string(name='triggerFilter', example='.*'),
            webhook?: string(name='webhook', example='https://flow.aliyun/webhook/asassasa'),
          }(name='data'),
          sign?: string(name='sign', example='xxsxsxs'),
          type?: string(name='type', example='Codeup'),
        }
      ](name='sources'),
    }(name='pipelineConfig'),
    tagList?: [ 
      {
        id?: long(name='id', example='22'),
        name?: string(name='name', example='标签1'),
      }
    ](name='tagList'),
    updateTime?: long(name='updateTime', example='1586863220000'),
  }(name='pipeline'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model GetPipelineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPipelineResponseBody(name='body'),
}

/**
 * @summary 获取流水线
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPipelineResponse
 */
async function getPipelineWithOptions(organizationId: string, pipelineId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetPipelineResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetPipeline',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流水线
 *
 * @return GetPipelineResponse
 */
async function getPipeline(organizationId: string, pipelineId: string): GetPipelineResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getPipelineWithOptions(organizationId, pipelineId, headers, runtime);
}

model GetPipelineArtifactUrlRequest {
  fileName?: string(name='fileName', description='This parameter is required.', example='test.tgz'),
  filePath?: string(name='filePath', description='This parameter is required.', example='/test/test/test.tgz'),
}

model GetPipelineArtifactUrlResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  fileUrl?: string(name='fileUrl', example='http://aliyun.com/'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model GetPipelineArtifactUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPipelineArtifactUrlResponseBody(name='body'),
}

/**
 * @summary 获取构建物下载链接
 *
 * @param request GetPipelineArtifactUrlRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPipelineArtifactUrlResponse
 */
async function getPipelineArtifactUrlWithOptions(organizationId: string, request: GetPipelineArtifactUrlRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetPipelineArtifactUrlResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.fileName)) {
    query['fileName'] = request.fileName;
  }
  if (!Util.isUnset(request.filePath)) {
    query['filePath'] = request.filePath;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetPipelineArtifactUrl',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipeline/getArtifactDownloadUrl`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取构建物下载链接
 *
 * @param request GetPipelineArtifactUrlRequest
 * @return GetPipelineArtifactUrlResponse
 */
async function getPipelineArtifactUrl(organizationId: string, request: GetPipelineArtifactUrlRequest): GetPipelineArtifactUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getPipelineArtifactUrlWithOptions(organizationId, request, headers, runtime);
}

model GetPipelineEmasArtifactUrlRequest {
  serviceConnectionId?: long(name='serviceConnectionId', description='This parameter is required.', example='122'),
}

model GetPipelineEmasArtifactUrlResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  fileUrl?: string(name='fileUrl', example='http://aliyun.com'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model GetPipelineEmasArtifactUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPipelineEmasArtifactUrlResponseBody(name='body'),
}

/**
 * @summary 获取emase构建物下载链接
 *
 * @param request GetPipelineEmasArtifactUrlRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPipelineEmasArtifactUrlResponse
 */
async function getPipelineEmasArtifactUrlWithOptions(organizationId: string, emasJobInstanceId: string, md5: string, pipelineId: string, pipelineRunId: string, request: GetPipelineEmasArtifactUrlRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetPipelineEmasArtifactUrlResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.serviceConnectionId)) {
    query['serviceConnectionId'] = request.serviceConnectionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetPipelineEmasArtifactUrl',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipeline/${OpenApiUtil.getEncodeParam(pipelineId)}/pipelineRun/${OpenApiUtil.getEncodeParam(pipelineRunId)}/emas/artifact/${OpenApiUtil.getEncodeParam(emasJobInstanceId)}/${OpenApiUtil.getEncodeParam(md5)}`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取emase构建物下载链接
 *
 * @param request GetPipelineEmasArtifactUrlRequest
 * @return GetPipelineEmasArtifactUrlResponse
 */
async function getPipelineEmasArtifactUrl(organizationId: string, emasJobInstanceId: string, md5: string, pipelineId: string, pipelineRunId: string, request: GetPipelineEmasArtifactUrlRequest): GetPipelineEmasArtifactUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getPipelineEmasArtifactUrlWithOptions(organizationId, emasJobInstanceId, md5, pipelineId, pipelineRunId, request, headers, runtime);
}

model GetPipelineGroupResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  pipelineGroup?: {
    createTime?: long(name='createTime', example='1586863220000'),
    id?: long(name='id', example='111'),
    name?: string(name='name'),
  }(name='pipelineGroup'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model GetPipelineGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPipelineGroupResponseBody(name='body'),
}

/**
 * @summary 获取流水线分组
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPipelineGroupResponse
 */
async function getPipelineGroupWithOptions(organizationId: string, groupId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetPipelineGroupResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetPipelineGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelineGroups/${OpenApiUtil.getEncodeParam(groupId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流水线分组
 *
 * @return GetPipelineGroupResponse
 */
async function getPipelineGroup(organizationId: string, groupId: string): GetPipelineGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getPipelineGroupWithOptions(organizationId, groupId, headers, runtime);
}

model GetPipelineRunResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  pipelineRun?: {
    createTime?: long(name='createTime', example='1586863220000'),
    creatorAccountId?: string(name='creatorAccountId', example='1111111111'),
    modifierAccountId?: string(name='modifierAccountId', example='11111111111'),
    pipelineId?: long(name='pipelineId', example='1234'),
    pipelineRunId?: long(name='pipelineRunId', example='1'),
    sources?: [ 
      {
        data?: {
          branch?: string(name='branch', example='master'),
          commint?: string(name='commint', example='{}'),
          repo?: string(name='repo', example='http://codeup.aliyun.com/a.git'),
        }(name='data'),
        sign?: string(name='sign', example='assaaaaaasasasa'),
        type?: string(name='type', example='Codeup'),
      }
    ](name='sources'),
    stageGroup?: [[ string ]    ](name='stageGroup'),
    stages?: [ 
      {
        name?: string(name='name', example='Java构建'),
        stageInfo?: {
          endTime?: long(name='endTime', example='1586863220000'),
          jobs?: [ 
            {
              actions?: [ 
                {
                  disable?: boolean(name='disable', example='true'),
                  params?: map[string]any(name='params', example='{}'),
                  type?: string(name='type', example='PassPipelineValidate'),
                }
              ](name='actions'),
              endTime?: long(name='endTime', example='1586863220000'),
              id?: long(name='id', example='21212'),
              name?: string(name='name', example='java构建'),
              params?: string(name='params', example='{}'),
              startTime?: long(name='startTime', example='1586863220000'),
              status?: string(name='status', example='RUNNING'),
            }
          ](name='jobs'),
          name?: string(name='name', example='Java构建'),
          startTime?: long(name='startTime', example='1586863220000'),
          status?: string(name='status', example='RUNNING'),
        }(name='stageInfo'),
      }
    ](name='stages'),
    status?: string(name='status', example='SUCCESS'),
    triggerMode?: int32(name='triggerMode', example='1'),
    updateTime?: long(name='updateTime', example='1586863220000'),
  }(name='pipelineRun'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model GetPipelineRunResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPipelineRunResponseBody(name='body'),
}

/**
 * @summary 获取流水线运行信息
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPipelineRunResponse
 */
async function getPipelineRunWithOptions(organizationId: string, pipelineId: string, pipelineRunId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetPipelineRunResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetPipelineRun',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/pipelineRuns/${OpenApiUtil.getEncodeParam(pipelineRunId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流水线运行信息
 *
 * @return GetPipelineRunResponse
 */
async function getPipelineRun(organizationId: string, pipelineId: string, pipelineRunId: string): GetPipelineRunResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getPipelineRunWithOptions(organizationId, pipelineId, pipelineRunId, headers, runtime);
}

model GetPipelineScanReportUrlRequest {
  reportPath?: string(name='reportPath', description='This parameter is required.', example='/test/test/test.html'),
}

model GetPipelineScanReportUrlResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  reportUrl?: string(name='reportUrl', example='http://aliyun.com'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model GetPipelineScanReportUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPipelineScanReportUrlResponseBody(name='body'),
}

/**
 * @summary 获取扫描报告下载链接
 *
 * @param request GetPipelineScanReportUrlRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPipelineScanReportUrlResponse
 */
async function getPipelineScanReportUrlWithOptions(organizationId: string, request: GetPipelineScanReportUrlRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetPipelineScanReportUrlResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.reportPath)) {
    body['reportPath'] = request.reportPath;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetPipelineScanReportUrl',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipeline/getPipelineScanReportUrl`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取扫描报告下载链接
 *
 * @param request GetPipelineScanReportUrlRequest
 * @return GetPipelineScanReportUrlResponse
 */
async function getPipelineScanReportUrl(organizationId: string, request: GetPipelineScanReportUrlRequest): GetPipelineScanReportUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getPipelineScanReportUrlWithOptions(organizationId, request, headers, runtime);
}

model GetProjectInfoResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='error'),
  project?: {
    category?: string(name='category', example='null'),
    categoryIdentifier?: string(name='categoryIdentifier', example='Project'),
    creator?: string(name='creator', example='19xx7043xxxxxxx914'),
    customCode?: string(name='customCode', example='OJAY'),
    description?: string(name='description', example='xxx'),
    gmtCreate?: long(name='gmtCreate', example='1623916393000'),
    gmtModified?: long(name='gmtModified', example='1623916393000'),
    icon?: string(name='icon', example='https://xxxxxx.png'),
    iconBig?: string(name='iconBig', example='https://xxxxxx.png'),
    iconGroup?: string(name='iconGroup', example='{"small":"https://xxxxxx.png","big":"https://img.yyyyyy.png"}'),
    iconSmall?: string(name='iconSmall', example='https://img.yyyyyy.png'),
    id?: string(name='id', example='null'),
    identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
    identifierPath?: string(name='identifierPath', example='e8b2xxxxxx2abdxxxxxxxx23'),
    logicalStatus?: string(name='logicalStatus', example='NORMAL'),
    modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
    name?: string(name='name'),
    organizationIdentifier?: string(name='organizationIdentifier', example='5e70xxxxxxcd000xxxxe96'),
    parentIdentifier?: string(name='parentIdentifier', example='null'),
    scope?: string(name='scope', example='public'),
    statusIdentifier?: string(name='statusIdentifier', example='8a40xxxxxxxxxxxxx64'),
    statusStageIdentifier?: string(name='statusStageIdentifier', example='8a4058a71159b68254......'),
    subType?: string(name='subType', example='null'),
    typeIdentifier?: string(name='typeIdentifier', example='CustomProject'),
  }(name='project'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model GetProjectInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProjectInfoResponseBody(name='body'),
}

/**
 * @summary 根据id获取项目详情-Projex
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetProjectInfoResponse
 */
async function getProjectInfoWithOptions(organizationId: string, projectId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProjectInfoResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetProjectInfo',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/project/${OpenApiUtil.getEncodeParam(projectId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 根据id获取项目详情-Projex
 *
 * @return GetProjectInfoResponse
 */
async function getProjectInfo(organizationId: string, projectId: string): GetProjectInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProjectInfoWithOptions(organizationId, projectId, headers, runtime);
}

model GetProjectMemberRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5eb53bb338076f00011bcfd5'),
}

model GetProjectMemberResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='30C99C69-A340-5E2E-ACE4-8888FF50CF52'),
  result?: {
    accessLevel?: int32(name='accessLevel', example='30'),
    avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c4ef67f1bea827c4/w/100/h/100'),
    email?: string(name='email'),
    id?: long(name='id', example='2959'),
    name?: string(name='name', example='codeup'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetProjectMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProjectMemberResponseBody(name='body'),
}

/**
 * @summary 查询代码库成员
 *
 * @param request GetProjectMemberRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetProjectMemberResponse
 */
async function getProjectMemberWithOptions(repositoryId: string, aliyunPk: string, request: GetProjectMemberRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProjectMemberResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetProjectMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/members/get/${OpenApiUtil.getEncodeParam(aliyunPk)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询代码库成员
 *
 * @param request GetProjectMemberRequest
 * @return GetProjectMemberResponse
 */
async function getProjectMember(repositoryId: string, aliyunPk: string, request: GetProjectMemberRequest): GetProjectMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProjectMemberWithOptions(repositoryId, aliyunPk, request, headers, runtime);
}

model GetReleaseStagePipelineRunRequest {
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199fcd'),
}

model GetReleaseStagePipelineRunResponseBody = {
  pipelineRun?: {
    createTime?: long(name='createTime', example='1586863220000'),
    creatorAccountId?: string(name='creatorAccountId', example='1111111111'),
    modifierAccountId?: string(name='modifierAccountId', example='11111111111'),
    pipelineId?: long(name='pipelineId', example='1234'),
    pipelineRunId?: long(name='pipelineRunId', example='1'),
    sources?: [ 
      {
        data?: {
          branch?: string(name='branch', example='master'),
          commit?: string(name='commit', example='{}'),
          repo?: string(name='repo', example='http://codeup.aliyun.com/a.git'),
        }(name='data'),
        sign?: string(name='sign', example='assaaaaaasasasa'),
        type?: string(name='type', example='Codeup'),
      }
    ](name='sources'),
    stageGroup?: [[ string ]    ](name='stageGroup'),
    stages?: [ 
      {
        name?: string(name='name'),
        stageInfo?: {
          endTime?: long(name='endTime', example='1586863220000'),
          jobs?: [ 
            {
              actions?: [ 
                {
                  disable?: boolean(name='disable', example='true'),
                  params?: any(name='params', example='{}'),
                  type?: string(name='type', example='PassPipelineValidate'),
                }
              ](name='actions'),
              endTime?: long(name='endTime', example='1586863220000'),
              id?: long(name='id', example='21212'),
              name?: string(name='name'),
              params?: string(name='params', example='{}'),
              startTime?: long(name='startTime', example='1586863220000'),
              status?: string(name='status', example='RUNNING'),
            }
          ](name='jobs'),
          name?: string(name='name'),
          startTime?: long(name='startTime', example='1586863220000'),
          status?: string(name='status', example='RUNNING'),
        }(name='stageInfo'),
      }
    ](name='stages'),
    status?: string(name='status', example='SUCCESS'),
    triggerMode?: int32(name='triggerMode', example='1'),
    updateTime?: long(name='updateTime', example='1586863220000'),
  }(name='pipelineRun'),
}

model GetReleaseStagePipelineRunResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetReleaseStagePipelineRunResponseBody(name='body'),
}

/**
 * @summary 获取研发阶段流水线运行实例
 *
 * @param request GetReleaseStagePipelineRunRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetReleaseStagePipelineRunResponse
 */
async function getReleaseStagePipelineRunWithOptions(appName: string, releaseWorkflowSn: string, releaseStageSn: string, executionNumber: string, request: GetReleaseStagePipelineRunRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetReleaseStagePipelineRunResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetReleaseStagePipelineRun',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/releaseWorkflows/${OpenApiUtil.getEncodeParam(releaseWorkflowSn)}/releaseStages/${OpenApiUtil.getEncodeParam(releaseStageSn)}/executions/${OpenApiUtil.getEncodeParam(executionNumber)}%3AgetPipelineRun`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取研发阶段流水线运行实例
 *
 * @param request GetReleaseStagePipelineRunRequest
 * @return GetReleaseStagePipelineRunResponse
 */
async function getReleaseStagePipelineRun(appName: string, releaseWorkflowSn: string, releaseStageSn: string, executionNumber: string, request: GetReleaseStagePipelineRunRequest): GetReleaseStagePipelineRunResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getReleaseStagePipelineRunWithOptions(appName, releaseWorkflowSn, releaseStageSn, executionNumber, request, headers, runtime);
}

model GetRepositoryRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  identity?: string(name='identity', description='This parameter is required.', example='100'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model GetRepositoryResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  repository?: {
    archive?: boolean(name='archive', example='false'),
    avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
    createdAt?: string(name='createdAt', example='2020-06-19T04:02:00.744Z'),
    creatorId?: long(name='creatorId', example='19258'),
    defaultBranch?: string(name='defaultBranch', example='master'),
    demoProjectStatus?: boolean(name='demoProjectStatus', example='false'),
    description?: string(name='description', example='repo desc'),
    httpUrlToRepository?: string(name='httpUrlToRepository', example='https://codeup.aliyun.com/xxx/test/test.git'),
    id?: long(name='id', example='100'),
    lastActivityAt?: string(name='lastActivityAt', example='2020-06-19T04:02:00.744Z'),
    name?: string(name='name', example='test'),
    nameWithNamespace?: string(name='nameWithNamespace', example='test / test'),
    namespace?: {
      avatar?: string(name='avatar', example='https://xxx.jpg'),
      createdAt?: string(name='createdAt', example='2020-06-19T04:02:00.744Z'),
      description?: string(name='description', example='repo desc'),
      id?: long(name='id', description='id', example='100'),
      name?: string(name='name', example='xxx'),
      ownerId?: long(name='ownerId', example='100'),
      path?: string(name='path', example='test'),
      updatedAt?: string(name='updatedAt', example='2020-06-19T04:02:00.744Z'),
      visibilityLevel?: int32(name='visibilityLevel', example='0'),
    }(name='namespace'),
    path?: string(name='path', example='test'),
    pathWithNamespace?: string(name='pathWithNamespace', example='test/test'),
    sshUrlToRepository?: string(name='sshUrlToRepository', example='git@codeup.aliyun.com:xxx/test/test.git'),
    visibilityLevel?: int32(name='visibilityLevel', example='0'),
    webUrl?: string(name='webUrl', example='https://codeup.aliyun.com/xxx/test/test'),
  }(name='repository'),
  requestId?: string(name='requestId', example='37294673-00CA-5B8B-914F-A8B35511E90A'),
  success?: boolean(name='success', example='true'),
}

model GetRepositoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRepositoryResponseBody(name='body'),
}

/**
 * @summary 使用代码库ID或路径查询代码库信息
 *
 * @param request GetRepositoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRepositoryResponse
 */
async function getRepositoryWithOptions(request: GetRepositoryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetRepositoryResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.identity)) {
    query['identity'] = request.identity;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetRepository',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/get`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 使用代码库ID或路径查询代码库信息
 *
 * @param request GetRepositoryRequest
 * @return GetRepositoryResponse
 */
async function getRepository(request: GetRepositoryRequest): GetRepositoryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getRepositoryWithOptions(request, headers, runtime);
}

model GetRepositoryCommitRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
  showSignature?: boolean(name='showSignature', example='false'),
}

model GetRepositoryCommitResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='A7586FEB-E48D-5579-983F-74981FBFF627'),
  result?: {
    author?: {
      avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c4ef67f1bea827c4/w/100/h/100'),
      email?: string(name='email', example='username@example.com'),
      id?: long(name='id', example='19927'),
      name?: string(name='name', example='test-codeup'),
      state?: string(name='state', example='active'),
      username?: string(name='username', example='test-nickname'),
      websiteUrl?: string(name='websiteUrl', example='""'),
    }(name='author'),
    authorEmail?: string(name='authorEmail', example='username@example.com'),
    authorName?: string(name='authorName', example='test-codeup'),
    authoredDate?: string(name='authoredDate', example='2022-03-18 15:00:00'),
    commentsCount?: long(name='commentsCount', example='1'),
    committedDate?: string(name='committedDate', example='2022-03-18 15:00:02'),
    committer?: {
      avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c4ef67f1bea827c4/w/100/h/100'),
      email?: string(name='email', example='username@example.com'),
      id?: long(name='id', example='24661'),
      name?: string(name='name', example='committer-codeup'),
      state?: string(name='state', example='active'),
      username?: string(name='username', example='nickname'),
      websiteUrl?: string(name='websiteUrl', example='""'),
    }(name='committer'),
    committerEmail?: string(name='committerEmail', example='username@example.com'),
    committerName?: string(name='committerName', example='committer-codeup'),
    createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
    id?: string(name='id', example='ff4fb5ac6d1f44f452654336d2dba468ae6c8d04'),
    message?: string(name='message'),
    parentIds?: [ string ](name='parentIds'),
    shortId?: string(name='shortId', example='ff4fb5ac'),
    signature?: {
      gpgKeyId?: string(name='gpgKeyId', example='34d2c47c7ce46a5c4639c5ffe208'),
      verificationStatus?: string(name='verificationStatus', example='verified'),
    }(name='signature'),
    title?: string(name='title'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetRepositoryCommitResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRepositoryCommitResponseBody(name='body'),
}

/**
 * @summary 查询代码库提交信息
 *
 * @param request GetRepositoryCommitRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRepositoryCommitResponse
 */
async function getRepositoryCommitWithOptions(repositoryId: string, sha: string, request: GetRepositoryCommitRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetRepositoryCommitResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.showSignature)) {
    query['showSignature'] = request.showSignature;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetRepositoryCommit',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/commits/${OpenApiUtil.getEncodeParam(sha)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询代码库提交信息
 *
 * @param request GetRepositoryCommitRequest
 * @return GetRepositoryCommitResponse
 */
async function getRepositoryCommit(repositoryId: string, sha: string, request: GetRepositoryCommitRequest): GetRepositoryCommitResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getRepositoryCommitWithOptions(repositoryId, sha, request, headers, runtime);
}

model GetRepositoryTagRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
  tagName?: string(name='tagName', description='This parameter is required.', example='tag v1.0'),
}

model GetRepositoryTagResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='CE7353E3-F989-56A9-B97C-897ABBDB9A01'),
  result?: {
    commit?: {
      authorEmail?: string(name='authorEmail', example='username@example.com'),
      authorName?: string(name='authorName'),
      authoredDate?: string(name='authoredDate', example='2022-03-18 08:00:00'),
      committedDate?: string(name='committedDate', example='2022-03-18 09:00:00'),
      committerEmail?: string(name='committerEmail', example='username@example.com'),
      committerName?: string(name='committerName'),
      createdAt?: string(name='createdAt', example='2022-03-18 10:00:00'),
      id?: string(name='id', example='e0297d8fb0393c833a8531e7cc8832739e3cba6d'),
      message?: string(name='message'),
      parentIds?: [ string ](name='parentIds'),
      shortId?: string(name='shortId', example='e0297d8f'),
      signature?: {
        gpgKeyId?: string(name='gpgKeyId', example='""'),
        verificationStatus?: string(name='verificationStatus', example='verified'),
      }(name='signature'),
      title?: string(name='title'),
    }(name='commit'),
    id?: string(name='id', example='9a494e7b88ca35cde00579af2df4ab46136c022e'),
    message?: string(name='message'),
    name?: string(name='name', example='tag v1.0'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetRepositoryTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRepositoryTagResponseBody(name='body'),
}

/**
 * @summary 查询单个标签
 *
 * @param request GetRepositoryTagRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRepositoryTagResponse
 */
async function getRepositoryTagWithOptions(repositoryId: string, request: GetRepositoryTagRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetRepositoryTagResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.tagName)) {
    query['tagName'] = request.tagName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetRepositoryTag',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/tag/info`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询单个标签
 *
 * @param request GetRepositoryTagRequest
 * @return GetRepositoryTagResponse
 */
async function getRepositoryTag(repositoryId: string, request: GetRepositoryTagRequest): GetRepositoryTagResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getRepositoryTagWithOptions(repositoryId, request, headers, runtime);
}

model GetSearchCodePreviewRequest {
  docId?: string(name='docId', description='This parameter is required.', example='60d54f3daccf2bbd6659f3ad/gitlabhq/master/config/environments/test.rb'),
  isDsl?: boolean(name='isDsl', example='false'),
  keyword?: string(name='keyword', description='This parameter is required.', example='test'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='627475075b46541dd2ff01bc'),
}

model GetSearchCodePreviewResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='A7586FEB-E48D-5579-983F-74981FBFF627'),
  result?: {
    docId?: string(name='docId', example='xxx'),
    highlightTextMap?: {
      clob?: string(name='clob', example='xxx'),
      fileName?: string(name='fileName', example='test.rb'),
      organizationId?: string(name='organizationId', example='5ffd468b1e45db3c1cc26ad6'),
    }(name='highlightTextMap'),
    source?: {
      branch?: string(name='branch', example='master'),
      checkinDate?: string(name='checkinDate', example='2022-12-12 12:12:12'),
      fileName?: string(name='fileName', example='test.rb'),
      filePath?: string(name='filePath', example='config/environments/test.rb'),
      language?: string(name='language', example='Ruby'),
      organizationId?: string(name='organizationId', example='5f9f9f6122a8c7ff3934f99a'),
      repoPath?: string(name='repoPath', example='codeup/test-repo'),
    }(name='source'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetSearchCodePreviewResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSearchCodePreviewResponseBody(name='body'),
}

/**
 * @summary 预览代码片段
 *
 * @param request GetSearchCodePreviewRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSearchCodePreviewResponse
 */
async function getSearchCodePreviewWithOptions(request: GetSearchCodePreviewRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetSearchCodePreviewResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.docId)) {
    query['docId'] = request.docId;
  }
  if (!Util.isUnset(request.isDsl)) {
    query['isDsl'] = request.isDsl;
  }
  if (!Util.isUnset(request.keyword)) {
    query['keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSearchCodePreview',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/search/code_preview`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 预览代码片段
 *
 * @param request GetSearchCodePreviewRequest
 * @return GetSearchCodePreviewResponse
 */
async function getSearchCodePreview(request: GetSearchCodePreviewRequest): GetSearchCodePreviewResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getSearchCodePreviewWithOptions(request, headers, runtime);
}

model GetSprintInfoResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='error'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  sprint?: {
    creator?: string(name='creator', example='19xx7043xxxxxxx914'),
    description?: string(name='description', example='xxx'),
    endDate?: long(name='endDate', example='1623916393000'),
    gmtCreate?: long(name='gmtCreate', example='1623916393000'),
    gmtModified?: long(name='gmtModified', example='1623916393000'),
    identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
    modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
    name?: string(name='name', example='demo示例项目'),
    owners?: [ string ](name='owners'),
    scope?: string(name='scope', example='public'),
    spaceIdentifier?: string(name='spaceIdentifier', example='5e70xxxxxxcd000xxxxe96'),
    startDate?: long(name='startDate', example='1638403200000'),
    status?: string(name='status', example='Todo'),
  }(name='sprint'),
  success?: boolean(name='success', example='true'),
}

model GetSprintInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSprintInfoResponseBody(name='body'),
}

/**
 * @summary 获取迭代详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSprintInfoResponse
 */
async function getSprintInfoWithOptions(organizationId: string, sprintId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetSprintInfoResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetSprintInfo',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/sprints/${OpenApiUtil.getEncodeParam(sprintId)}/getSprintinfo`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取迭代详情
 *
 * @return GetSprintInfoResponse
 */
async function getSprintInfo(organizationId: string, sprintId: string): GetSprintInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getSprintInfoWithOptions(organizationId, sprintId, headers, runtime);
}

model GetTestResultListRequest {
  conditions?: string(name='conditions', example='{\\\\"conditionGroups\\\\": [[{\\\\"fieldIdentifier\\\\": \\\\"gmtModified\\\\", \\\\"operator\\\\": \\\\"MORE_THAN_AND_EQUAL\\\\", \\\\"value\\\\": [\\\\"2023-04-20 18:03:12.442140\\\\"], \\\\"className\\\\": \\\\"dateTime\\\\", \\\\"format\\\\": \\\\"input\\\\"}]]}'),
  directoryIdentifier?: string(name='directoryIdentifier', description='This parameter is required.', example='e27b8eace6501ce51cf5d56784'),
}

model GetTestResultListResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  testResult?: [ 
    {
      assignedTo?: {
        assignedToIdenttifier?: string(name='assignedToIdenttifier'),
        name?: string(name='name'),
      }(name='assignedTo'),
      bugCount?: long(name='bugCount', example='8'),
      categoryIdentifier?: string(name='categoryIdentifier', example='Req'),
      customFields?: [ 
        {
          fieldClassName?: string(name='fieldClassName'),
          fieldFormat?: string(name='fieldFormat'),
          fieldIdentifier?: string(name='fieldIdentifier'),
          value?: string(name='value'),
        }
      ](name='customFields'),
      gmtCreate?: long(name='gmtCreate'),
      spaceIdentifier?: string(name='spaceIdentifier'),
      subject?: string(name='subject', example='测试工作项'),
      testResultExecutor?: {
        executorIdentifier?: string(name='executorIdentifier'),
        name?: string(name='name'),
      }(name='testResultExecutor'),
      testResultGmtCreate?: long(name='testResultGmtCreate'),
      testResultIdentifier?: string(name='testResultIdentifier', example='a8bxxxxxxxxxxxxxxxx54'),
      testResultStatus?: string(name='testResultStatus', example='TO DO'),
      testcaseIdentifier?: string(name='testcaseIdentifier'),
    }
  ](name='testResult'),
}

model GetTestResultListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTestResultListResponseBody(name='body'),
}

/**
 * @summary 获取测试计划中的测试用例列表
 *
 * @param request GetTestResultListRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTestResultListResponse
 */
async function getTestResultListWithOptions(organizationId: string, testPlanIdentifier: string, request: GetTestResultListRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetTestResultListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.conditions)) {
    body['conditions'] = request.conditions;
  }
  if (!Util.isUnset(request.directoryIdentifier)) {
    body['directoryIdentifier'] = request.directoryIdentifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetTestResultList',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/testhub/testplan/${OpenApiUtil.getEncodeParam(testPlanIdentifier)}/testresults`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取测试计划中的测试用例列表
 *
 * @param request GetTestResultListRequest
 * @return GetTestResultListResponse
 */
async function getTestResultList(organizationId: string, testPlanIdentifier: string, request: GetTestResultListRequest): GetTestResultListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTestResultListWithOptions(organizationId, testPlanIdentifier, request, headers, runtime);
}

model GetTestcaseListRequest {
  conditions?: string(name='conditions', example='{\\\\"conditionGroups\\\\":[[{\\\\"fieldIdentifier\\\\":\\\\"status\\\\",\\\\"operator\\\\":\\\\"CONTAINS\\\\",\\\\"value\\\\":[\\\\"cc961a18adf770c6e423ccc5\\\\"],\\\\"toValue\\\\":null,,\\\\"className\\\\":\\\\"status\\\\",\\\\"format\\\\":\\\\"list\\\\"}]]}'),
  directoryIdentifier?: string(name='directoryIdentifier', example='e27b8eace6501ce51cf5d56784'),
  maxResult?: string(name='maxResult', example='20'),
  nextToken?: string(name='nextToken', example='2591861102250c4522380b33a6'),
  spaceIdentifier?: string(name='spaceIdentifier', description='This parameter is required.', example='6d5984c7d92b23fa53d4743c37'),
}

model GetTestcaseListResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  maxResults?: long(name='maxResults', example='20'),
  nextToken?: string(name='nextToken', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  testcase?: [ 
    {
      assignedTo?: {
        assignedToIdenttifier?: string(name='assignedToIdenttifier', example='12xxxxx456'),
        name?: string(name='name'),
      }(name='assignedTo'),
      categoryIdentifier?: string(name='categoryIdentifier', example='Req'),
      customFields?: [ 
        {
          fieldClassName?: string(name='fieldClassName', example='User'),
          fieldFormat?: string(name='fieldFormat', example='Input'),
          fieldIdentifier?: string(name='fieldIdentifier', example='85702b33f14bfa82cb458173ba'),
          value?: string(name='value', example='d7f112f9d023e2108fa1b0d8'),
        }
      ](name='customFields'),
      gmtCreate?: long(name='gmtCreate', example='1621578648000'),
      identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
      space?: {
        spaceIdentifier?: string(name='spaceIdentifier', example='22c32972b853cd703dbf0efe4c'),
        type?: string(name='type', example='TestRepo'),
      }(name='space'),
      subject?: string(name='subject', example='测试工作项'),
      tags?: [ 
        {
          name?: string(name='name'),
          tagIdentifier?: string(name='tagIdentifier', example='85702b33f14bxxxxxx58173ba'),
        }
      ](name='tags'),
    }
  ](name='testcase'),
  totalCount?: long(name='totalCount', example='10'),
}

model GetTestcaseListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTestcaseListResponseBody(name='body'),
}

/**
 * @summary 获取测试用例列表
 *
 * @param request GetTestcaseListRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTestcaseListResponse
 */
async function getTestcaseListWithOptions(organizationId: string, request: GetTestcaseListRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetTestcaseListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.conditions)) {
    body['conditions'] = request.conditions;
  }
  if (!Util.isUnset(request.directoryIdentifier)) {
    body['directoryIdentifier'] = request.directoryIdentifier;
  }
  if (!Util.isUnset(request.maxResult)) {
    body['maxResult'] = request.maxResult;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.spaceIdentifier)) {
    body['spaceIdentifier'] = request.spaceIdentifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetTestcaseList',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/testhub/testcases`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取测试用例列表
 *
 * @param request GetTestcaseListRequest
 * @return GetTestcaseListResponse
 */
async function getTestcaseList(organizationId: string, request: GetTestcaseListRequest): GetTestcaseListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTestcaseListWithOptions(organizationId, request, headers, runtime);
}

model GetUserInfoRequest {
  organizationId?: string(name='organizationId', example='61e54b0e0bb300d827e1ae27'),
}

model GetUserInfoResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: {
    avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
    email?: string(name='email', example='username@example.com'),
    id?: long(name='id', example='4205'),
    name?: string(name='name'),
    username?: string(name='username'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model GetUserInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUserInfoResponseBody(name='body'),
}

/**
 * @summary 查询当前用户信息
 *
 * @param request GetUserInfoRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUserInfoResponse
 */
async function getUserInfoWithOptions(request: GetUserInfoRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetUserInfoResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUserInfo',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/users/current`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询当前用户信息
 *
 * @param request GetUserInfoRequest
 * @return GetUserInfoResponse
 */
async function getUserInfo(request: GetUserInfoRequest): GetUserInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getUserInfoWithOptions(request, headers, runtime);
}

model GetVMDeployOrderResponseBody = {
  deployOrder?: {
    actions?: [ 
      {
        disable?: boolean(name='disable', example='true'),
        params?: any(name='params', example='{}'),
        type?: string(name='type', example='StopVMDeployOrder'),
      }
    ](name='actions'),
    createTime?: long(name='createTime', example='111111111111'),
    creator?: string(name='creator', example='ssaassa'),
    currentBatch?: int32(name='currentBatch', example='2'),
    deployMachineInfo?: {
      batchNum?: int32(name='batchNum', example='11'),
      deployMachines?: [ 
        {
          actions?: [ 
            {
              disable?: boolean(name='disable', example='true'),
              params?: any(name='params', example='{}'),
              type?: string(name='type', example='RetryVMDeployMachine'),
            }
          ](name='actions'),
          batchNum?: int32(name='batchNum', example='22'),
          clientStatus?: string(name='clientStatus', example='ok'),
          createTime?: long(name='createTime', example='1111111111'),
          ip?: string(name='ip', example='127.0.0.1'),
          machineSn?: string(name='machineSn', example='sasssasa'),
          status?: string(name='status', example='Success'),
          updateTime?: long(name='updateTime', example='11111111'),
        }
      ](name='deployMachines'),
      hostGroupId?: long(name='hostGroupId', example='1111'),
    }(name='deployMachineInfo'),
    deployOrderId?: string(name='deployOrderId', example='11111'),
    exceptionCode?: string(name='exceptionCode'),
    status?: string(name='status', example='Success'),
    totalBatch?: int32(name='totalBatch', example='3'),
    updateTime?: long(name='updateTime', example='11111111111'),
  }(name='deployOrder'),
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model GetVMDeployOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVMDeployOrderResponseBody(name='body'),
}

/**
 * @summary 获取部署单信息
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVMDeployOrderResponse
 */
async function getVMDeployOrderWithOptions(organizationId: string, pipelineId: string, deployOrderId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetVMDeployOrderResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetVMDeployOrder',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/deploy/${OpenApiUtil.getEncodeParam(deployOrderId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取部署单信息
 *
 * @return GetVMDeployOrderResponse
 */
async function getVMDeployOrder(organizationId: string, pipelineId: string, deployOrderId: string): GetVMDeployOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getVMDeployOrderWithOptions(organizationId, pipelineId, deployOrderId, headers, runtime);
}

model GetVariableGroupResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  variableGroup?: {
    ccreatorAccountId?: string(name='ccreatorAccountId', example='13232343434343'),
    createTime?: long(name='createTime', example='1586863220000'),
    description?: string(name='description', example='变量组'),
    id?: long(name='id', example='12234'),
    modifierAccountId?: string(name='modifierAccountId', example='13232343434343'),
    name?: string(name='name', example='变量组'),
    relatedPipelines?: [ 
      {
        id?: long(name='id', example='1234'),
        name?: string(name='name', example='流水线'),
      }
    ](name='relatedPipelines'),
    updateTime?: long(name='updateTime', example='1586863220000'),
    variables?: [ 
      {
        isEncrypted?: boolean(name='isEncrypted', example='true'),
        name?: string(name='name', example='name1'),
        value?: string(name='value', example='value1'),
      }
    ](name='variables'),
  }(name='variableGroup'),
}

model GetVariableGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVariableGroupResponseBody(name='body'),
}

/**
 * @summary 获取变量组
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVariableGroupResponse
 */
async function getVariableGroupWithOptions(organizationId: string, id: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetVariableGroupResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetVariableGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/variableGroups/${OpenApiUtil.getEncodeParam(id)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取变量组
 *
 * @return GetVariableGroupResponse
 */
async function getVariableGroup(organizationId: string, id: string): GetVariableGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getVariableGroupWithOptions(organizationId, id, headers, runtime);
}

model GetWorkItemActivityResponseBody = {
  activities?: [ 
    {
      actionType?: string(name='actionType', example='update'),
      eventId?: long(name='eventId', example='3201131'),
      eventTime?: long(name='eventTime', example='1640867079624'),
      eventType?: string(name='eventType', example='workitem.updated'),
      newValue?: [ 
        {
          displayValue?: string(name='displayValue', example='Sprint-221124'),
          plainValue?: string(name='plainValue', example='bed1cca179badeb501a72d1194'),
          resourceType?: string(name='resourceType', example='Sprint'),
        }
      ](name='newValue'),
      oldValue?: [ 
        {
          displayValue?: string(name='displayValue', example='Sprint-221124'),
          plainValue?: string(name='plainValue', example='bed1cca179badeb501a72d1194'),
          resourceType?: string(name='resourceType', example='Sprint'),
        }
      ](name='oldValue'),
      operator?: string(name='operator', example='19xx7043xxxxxxx914'),
      parentEventId?: long(name='parentEventId', example='3201132'),
      property?: {
        displayName?: string(name='displayName', example='标题'),
        propertyIdentifier?: string(name='propertyIdentifier', example='subject'),
        propertyName?: string(name='propertyName', example='subject'),
        propertyType?: string(name='propertyType', example='null'),
      }(name='property', example='public'),
      resourceIdentifier?: string(name='resourceIdentifier', example='e8bxxxxxxxxxxxxxxxx23'),
    }
  ](name='activities'),
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model GetWorkItemActivityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWorkItemActivityResponseBody(name='body'),
}

/**
 * @summary 获取工作项动态
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWorkItemActivityResponse
 */
async function getWorkItemActivityWithOptions(organizationId: string, workitemId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetWorkItemActivityResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetWorkItemActivity',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/${OpenApiUtil.getEncodeParam(workitemId)}/getActivity`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取工作项动态
 *
 * @return GetWorkItemActivityResponse
 */
async function getWorkItemActivity(organizationId: string, workitemId: string): GetWorkItemActivityResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getWorkItemActivityWithOptions(organizationId, workitemId, headers, runtime);
}

model GetWorkItemInfoResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='error'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  workitem?: {
    assignedTo?: string(name='assignedTo', example='19xx7043xxxxxxx914'),
    categoryIdentifier?: string(name='categoryIdentifier', example='Req'),
    creator?: string(name='creator', example='19xx7043xxxxxxx914'),
    customFields?: [ 
      {
        fieldClassName?: string(name='fieldClassName', example='例如：date'),
        fieldFormat?: string(name='fieldFormat', example='例：input'),
        fieldIdentifier?: string(name='fieldIdentifier', example='例：80'),
        level?: long(name='level', example='1'),
        objectValue?: string(name='objectValue', example='null'),
        position?: long(name='position', example='1'),
        value?: string(name='value', example='例：2022-01-06 00:00:00'),
        valueList?: [ 
          {
            displayValue?: string(name='displayValue', example='2022-02-01 00:00:00'),
            identifier?: string(name='identifier', example='2022-02-01 00:00:00'),
            level?: long(name='level', example='1'),
            value?: string(name='value', example='2022-02-01 00:00:00'),
            valueEn?: string(name='valueEn', example='null'),
          }
        ](name='valueList'),
        workitemIdentifier?: string(name='workitemIdentifier', example='5daa9a15c7fd55523996......'),
      }
    ](name='customFields'),
    document?: string(name='document', example='html格式'),
    documentFormat?: string(name='documentFormat'),
    finishTime?: long(name='finishTime'),
    gmtCreate?: long(name='gmtCreate', example='1640850318000'),
    gmtModified?: long(name='gmtModified', example='1640850318000'),
    identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
    logicalStatus?: string(name='logicalStatus', example='NORMAL'),
    modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
    parentIdentifier?: string(name='parentIdentifier', example='e8bxxxxxxxxxxxxxxxx24'),
    participant?: [ string ](name='participant'),
    serialNumber?: string(name='serialNumber', example='ABCD-1'),
    spaceIdentifier?: string(name='spaceIdentifier', example='e8b26xxxxx6e76aa20xxxxx23'),
    spaceName?: string(name='spaceName', example='需求项目'),
    spaceType?: string(name='spaceType', example='Project'),
    sprint?: [ string ](name='sprint'),
    status?: string(name='status', example='待处理'),
    statusIdentifier?: string(name='statusIdentifier', example='例：100005'),
    statusStageIdentifier?: string(name='statusStageIdentifier', example='1'),
    subject?: string(name='subject', example='测试工作项'),
    tag?: [ string ](name='tag'),
    tagDetails?: [ 
      {
        color?: string(name='color'),
        identifier?: string(name='identifier'),
        name?: string(name='name'),
      }
    ](name='tagDetails'),
    tracker?: [ string ](name='tracker'),
    updateStatusAt?: long(name='updateStatusAt', example='1640850328000'),
    verifier?: [ string ](name='verifier'),
    versions?: [ 
      {
        identifier?: string(name='identifier'),
        name?: string(name='name'),
      }
    ](name='versions'),
    workitemTypeIdentifier?: string(name='workitemTypeIdentifier', example='9uxxxxxxre573f5xxxxxx0'),
  }(name='workitem'),
}

model GetWorkItemInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWorkItemInfoResponseBody(name='body'),
}

/**
 * @summary 根据id获取工作项详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWorkItemInfoResponse
 */
async function getWorkItemInfoWithOptions(organizationId: string, workitemId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetWorkItemInfoResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetWorkItemInfo',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/${OpenApiUtil.getEncodeParam(workitemId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 根据id获取工作项详情
 *
 * @return GetWorkItemInfoResponse
 */
async function getWorkItemInfo(organizationId: string, workitemId: string): GetWorkItemInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getWorkItemInfoWithOptions(organizationId, workitemId, headers, runtime);
}

model GetWorkItemWorkFlowInfoRequest {
  configurationId?: string(name='configurationId', example='711d33c738b9171c45fa......'),
}

model GetWorkItemWorkFlowInfoResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='error'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  workflow?: {
    creator?: string(name='creator', example='19xx7043xxxxxxx914'),
    defaultStatusIdentifier?: string(name='defaultStatusIdentifier', example='100005'),
    description?: string(name='description', example='工作流的描述'),
    gmtCreate?: long(name='gmtCreate', example='1640850318000'),
    gmtModified?: long(name='gmtModified', example='1640850318000'),
    identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
    modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
    name?: string(name='name', example='名称'),
    ownerSpaceIdentifier?: string(name='ownerSpaceIdentifier', example='e8b26xxxxx6e76aa20xxxxx23'),
    ownerSpaceType?: string(name='ownerSpaceType', example='null'),
    resourceType?: string(name='resourceType', example='Project'),
    source?: string(name='source', example='system'),
    statusOrder?: string(name='statusOrder', example='null'),
    statuses?: [ 
      {
        creator?: string(name='creator', example='19xx7043xxxxxxx914'),
        description?: string(name='description', example='xxx'),
        gmtCreate?: long(name='gmtCreate', example='1613805843000'),
        gmtModified?: long(name='gmtModified', example='1613805843000'),
        identifier?: string(name='identifier', example='156603'),
        modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
        name?: string(name='name', example='待处理'),
        resourceType?: string(name='resourceType', example='Workitem'),
        source?: string(name='source', example='system'),
        workflowStageIdentifier?: string(name='workflowStageIdentifier', example='1'),
        workflowStageName?: string(name='workflowStageName', example='确认阶段'),
      }
    ](name='statuses'),
    workflowActions?: [ 
      {
        id?: long(name='id', example='16274887'),
        name?: string(name='name', example='xxx'),
        nextWorkflowStatusIdentifier?: string(name='nextWorkflowStatusIdentifier', example='100011'),
        workflowIdentifier?: string(name='workflowIdentifier', example='fd0xxxxxd00d355b05dxxxx26'),
        workflowStatusIdentifier?: string(name='workflowStatusIdentifier', example='100005'),
      }
    ](name='workflowActions'),
  }(name='workflow'),
}

model GetWorkItemWorkFlowInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWorkItemWorkFlowInfoResponseBody(name='body'),
}

/**
 * @summary 获取工作项工作流信息
 *
 * @param request GetWorkItemWorkFlowInfoRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWorkItemWorkFlowInfoResponse
 */
async function getWorkItemWorkFlowInfoWithOptions(organizationId: string, workitemId: string, request: GetWorkItemWorkFlowInfoRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetWorkItemWorkFlowInfoResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.configurationId)) {
    query['configurationId'] = request.configurationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetWorkItemWorkFlowInfo',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/${OpenApiUtil.getEncodeParam(workitemId)}/getWorkflowInfo`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取工作项工作流信息
 *
 * @param request GetWorkItemWorkFlowInfoRequest
 * @return GetWorkItemWorkFlowInfoResponse
 */
async function getWorkItemWorkFlowInfo(organizationId: string, workitemId: string, request: GetWorkItemWorkFlowInfoRequest): GetWorkItemWorkFlowInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getWorkItemWorkFlowInfoWithOptions(organizationId, workitemId, request, headers, runtime);
}

model GetWorkitemAttachmentCreatemetaRequest {
  fileName?: string(name='fileName', description='This parameter is required.', example='application.jar'),
}

model GetWorkitemAttachmentCreatemetaResponseBody = {
  errorCode?: string(name='errorCode', example='Invalid.IdNotFound'),
  errorMessage?: string(name='errorMessage', example='Forbidden.UserNotInCurrentOrganization'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: string(name='success', example='true'),
  uploadInfo?: {
    accessid?: string(name='accessid', example='xxxxxxx'),
    dir?: string(name='dir', example='ddd/dddd'),
    host?: string(name='host', example='xxxxx'),
    policy?: string(name='policy', example='xxxxxxx'),
    signature?: string(name='signature', example='xdWcrl/yTmIUA0kE7a3B0Ox4Vu8='),
  }(name='uploadInfo'),
}

model GetWorkitemAttachmentCreatemetaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWorkitemAttachmentCreatemetaResponseBody(name='body'),
}

/**
 * @summary 获取附件上传的元信息
 *
 * @param request GetWorkitemAttachmentCreatemetaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWorkitemAttachmentCreatemetaResponse
 */
async function getWorkitemAttachmentCreatemetaWithOptions(organizationId: string, workitemIdentifier: string, request: GetWorkitemAttachmentCreatemetaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetWorkitemAttachmentCreatemetaResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.fileName)) {
    query['fileName'] = request.fileName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetWorkitemAttachmentCreatemeta',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitem/${OpenApiUtil.getEncodeParam(workitemIdentifier)}/attachment/createmeta`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取附件上传的元信息
 *
 * @param request GetWorkitemAttachmentCreatemetaRequest
 * @return GetWorkitemAttachmentCreatemetaResponse
 */
async function getWorkitemAttachmentCreatemeta(organizationId: string, workitemIdentifier: string, request: GetWorkitemAttachmentCreatemetaRequest): GetWorkitemAttachmentCreatemetaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getWorkitemAttachmentCreatemetaWithOptions(organizationId, workitemIdentifier, request, headers, runtime);
}

model GetWorkitemCommentListResponseBody = {
  commentList?: [ 
    {
      content?: string(name='content', example='066961'),
      createTime?: long(name='createTime', example='1667205617061'),
      formatType?: string(name='formatType', example='RICHTEXT/MARKDOWN'),
      id?: long(name='id', example='6573'),
      isTop?: boolean(name='isTop', example='true/false'),
      modifiedTime?: long(name='modifiedTime', example='1646323200000'),
      parentId?: long(name='parentId', example='1013131897677566'),
      targetIdentifier?: string(name='targetIdentifier', example='9144ef6b72d8exxxxx9e61a4d0'),
      targetType?: string(name='targetType', example='workitem'),
      topTime?: long(name='topTime', example='1667205617089'),
      user?: {
        account?: string(name='account'),
        avatar?: string(name='avatar'),
        identifier?: string(name='identifier'),
        nickName?: string(name='nickName'),
        realName?: string(name='realName'),
      }(name='user'),
    }
  ](name='commentList'),
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', description='Id of the request', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: string(name='success'),
}

model GetWorkitemCommentListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWorkitemCommentListResponseBody(name='body'),
}

/**
 * @summary 获得所有评论
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWorkitemCommentListResponse
 */
async function getWorkitemCommentListWithOptions(organizationId: string, workitemId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetWorkitemCommentListResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetWorkitemCommentList',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/${OpenApiUtil.getEncodeParam(workitemId)}/commentList`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获得所有评论
 *
 * @return GetWorkitemCommentListResponse
 */
async function getWorkitemCommentList(organizationId: string, workitemId: string): GetWorkitemCommentListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getWorkitemCommentListWithOptions(organizationId, workitemId, headers, runtime);
}

model GetWorkitemFileResponseBody = {
  errorCode?: string(name='errorCode', example='success'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', description='Id of the request', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: string(name='success', example='true'),
  workitemFile?: {
    id?: string(name='id', example='sddrdfdf123df'),
    name?: string(name='name', example='ddc.pdf'),
    size?: int32(name='size', example='10001'),
    suffix?: string(name='suffix', example='pdf'),
    url?: string(name='url', example='http://tmaestro-oss.oss-cn-hongkong.aliyuncs.com/thread_1682129288279.log'),
  }(name='workitemFile'),
}

model GetWorkitemFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWorkitemFileResponseBody(name='body'),
}

/**
 * @summary 获取工作项文件信息
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWorkitemFileResponse
 */
async function getWorkitemFileWithOptions(organizationId: string, workitemIdentifier: string, fileIdentifier: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetWorkitemFileResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetWorkitemFile',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitem/${OpenApiUtil.getEncodeParam(workitemIdentifier)}/files/${OpenApiUtil.getEncodeParam(fileIdentifier)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取工作项文件信息
 *
 * @return GetWorkitemFileResponse
 */
async function getWorkitemFile(organizationId: string, workitemIdentifier: string, fileIdentifier: string): GetWorkitemFileResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getWorkitemFileWithOptions(organizationId, workitemIdentifier, fileIdentifier, headers, runtime);
}

model GetWorkitemRelationsRequest {
  relationType?: string(name='relationType', description='This parameter is required.'),
}

model GetWorkitemRelationsResponseBody = {
  errorCode?: string(name='errorCode', example='InvalidGroup.IdNotFound'),
  errorMsg?: string(name='errorMsg', example='error'),
  relationList?: [ 
    {
      assignedTo?: string(name='assignedTo', example='aliyun_1384605'),
      categoryIdentifier?: string(name='categoryIdentifier', example='Req'),
      gmtCreate?: string(name='gmtCreate', example='1667205617061'),
      gmtModified?: string(name='gmtModified', example='1667205617089'),
      identifier?: string(name='identifier', example='deafe5f33xxxxx6a259d8dafd'),
      spaceIdentifier?: string(name='spaceIdentifier', example='2b856dxxxxxxb61d93676255ba'),
      subject?: string(name='subject'),
      workitemTypeIdentifier?: string(name='workitemTypeIdentifier', example='9uy29901re573f561d69jn40'),
    }
  ](name='relationList'),
  requestId?: string(name='requestId', description='Id of the request', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model GetWorkitemRelationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWorkitemRelationsResponseBody(name='body'),
}

/**
 * @summary 获得一个工作项的指定关联项
 *
 * @param request GetWorkitemRelationsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWorkitemRelationsResponse
 */
async function getWorkitemRelationsWithOptions(organizationId: string, workitemId: string, request: GetWorkitemRelationsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetWorkitemRelationsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.relationType)) {
    query['relationType'] = request.relationType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetWorkitemRelations',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/${OpenApiUtil.getEncodeParam(workitemId)}/getRelations`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获得一个工作项的指定关联项
 *
 * @param request GetWorkitemRelationsRequest
 * @return GetWorkitemRelationsResponse
 */
async function getWorkitemRelations(organizationId: string, workitemId: string, request: GetWorkitemRelationsRequest): GetWorkitemRelationsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getWorkitemRelationsWithOptions(organizationId, workitemId, request, headers, runtime);
}

model GetWorkitemTimeTypeListResponseBody = {
  errorCode?: string(name='errorCode', example='Invalid.IdNotFound'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', description='Id of the request', example='HC93CE1A-8D7A-13A9-8306-7465DE2E5C0F'),
  success?: string(name='success', example='true'),
  timeType?: [ 
    {
      description?: string(name='description'),
      displayName?: string(name='displayName', example='deploy'),
      identifier?: string(name='identifier', example='67fb001005aac8d3d2a3372416'),
      name?: string(name='name'),
      position?: long(name='position', example='1'),
    }
  ](name='timeType'),
}

model GetWorkitemTimeTypeListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWorkitemTimeTypeListResponseBody(name='body'),
}

/**
 * @summary 获得一个企业下所有工时类型
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWorkitemTimeTypeListResponse
 */
async function getWorkitemTimeTypeListWithOptions(organizationId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetWorkitemTimeTypeListResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetWorkitemTimeTypeList',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/type/list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获得一个企业下所有工时类型
 *
 * @return GetWorkitemTimeTypeListResponse
 */
async function getWorkitemTimeTypeList(organizationId: string): GetWorkitemTimeTypeListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getWorkitemTimeTypeListWithOptions(organizationId, headers, runtime);
}

model JoinPipelineGroupRequest {
  groupId?: long(name='groupId', description='This parameter is required.', example='11'),
  pipelineIds?: string(name='pipelineIds', description='This parameter is required.', example='122,122'),
}

model JoinPipelineGroupResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model JoinPipelineGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: JoinPipelineGroupResponseBody(name='body'),
}

/**
 * @summary 加入流水线分组
 *
 * @param request JoinPipelineGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return JoinPipelineGroupResponse
 */
async function joinPipelineGroupWithOptions(organizationId: string, request: JoinPipelineGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): JoinPipelineGroupResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.groupId)) {
    query['groupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pipelineIds)) {
    query['pipelineIds'] = request.pipelineIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'JoinPipelineGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelineGroups/join`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 加入流水线分组
 *
 * @param request JoinPipelineGroupRequest
 * @return JoinPipelineGroupResponse
 */
async function joinPipelineGroup(organizationId: string, request: JoinPipelineGroupRequest): JoinPipelineGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return joinPipelineGroupWithOptions(organizationId, request, headers, runtime);
}

model LinkMergeRequestLabelRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  labelIds?: [ string ](name='labelIds', description='This parameter is required.'),
  localId?: long(name='localId', description='This parameter is required.', example='1'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
}

model LinkMergeRequestLabelResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model LinkMergeRequestLabelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LinkMergeRequestLabelResponseBody(name='body'),
}

/**
 * @summary 关联合并请求Label
 *
 * @param request LinkMergeRequestLabelRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return LinkMergeRequestLabelResponse
 */
async function linkMergeRequestLabelWithOptions(request: LinkMergeRequestLabelRequest, headers: map[string]string, runtime: Util.RuntimeOptions): LinkMergeRequestLabelResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.localId)) {
    query['localId'] = request.localId;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.labelIds)) {
    body['labelIds'] = request.labelIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'LinkMergeRequestLabel',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/merge_requests/link_labels`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 关联合并请求Label
 *
 * @param request LinkMergeRequestLabelRequest
 * @return LinkMergeRequestLabelResponse
 */
async function linkMergeRequestLabel(request: LinkMergeRequestLabelRequest): LinkMergeRequestLabelResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return linkMergeRequestLabelWithOptions(request, headers, runtime);
}

model ListAllReleaseWorkflowsRequest {
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199fcd'),
}

model ListAllReleaseWorkflowsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: [ 
    {
      appName?: string(name='appName', example='testApp'),
      sn?: string(name='sn', example='ce51b31b996246ecaf874736838360b2'),
      name?: string(name='name'),
      order?: string(name='order', example='1'),
      releaseStages?: [ 
        {
          appName?: string(name='appName', example='testApp'),
          name?: string(name='name'),
          sn?: string(name='sn', example='5aa8cc67e75e41bf9dddeb708775bcc3'),
          releaseWorkflowSn?: string(name='releaseWorkflowSn', example='ce51b31b996246ecaf874736838360b2'),
          order?: string(name='order', example='1'),
          variableGroups?: [ 
            {
              name?: string(name='name', example='dev'),
              displayName?: string(name='displayName'),
              type?: string(name='type', example='APP'),
            }
          ](name='variableGroups'),
        }
      ](name='releaseStages'),
      note?: string(name='note', example='""'),
    }
  ](name='body'),
}

/**
 * @summary 查找应用下所有的研发流程
 *
 * @param request ListAllReleaseWorkflowsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAllReleaseWorkflowsResponse
 */
async function listAllReleaseWorkflowsWithOptions(appName: string, request: ListAllReleaseWorkflowsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListAllReleaseWorkflowsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAllReleaseWorkflows',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/releaseWorkflows`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'array',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查找应用下所有的研发流程
 *
 * @param request ListAllReleaseWorkflowsRequest
 * @return ListAllReleaseWorkflowsResponse
 */
async function listAllReleaseWorkflows(appName: string, request: ListAllReleaseWorkflowsRequest): ListAllReleaseWorkflowsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listAllReleaseWorkflowsWithOptions(appName, request, headers, runtime);
}

model ListAppReleaseStageExecutionIntegratedMetadataRequest {
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199fcd'),
}

model ListAppReleaseStageExecutionIntegratedMetadataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: [ 
    {
      releaseBranch?: string(name='releaseBranch', example='release/20240625-152603220321211_release_3252057_1'),
      releaseRevision?: string(name='releaseRevision', example='a66cfa8c6869b96bb7d111ba2144c9c764d556b7'),
      repoUrl?: string(name='repoUrl', example='https://codeup.aliyun.com/60d54f3daccf2bbd6659f3ad/auto-test.git'),
      repoType?: string(name='repoType', example='CODEUP'),
      changeRequests?: [ 
        {
          sn?: string(name='sn', example='fcd37726a6f84c60b7eb9c5856007c2f'),
          name?: string(name='name'),
          branchName?: string(name='branchName', example='feature/20240625'),
          commitId?: string(name='commitId', example='a66cfa8c6869b96bb7d111ba2144c9c764d556b7'),
          ownerAccountId?: string(name='ownerAccountId', example='262579140573491041'),
        }
      ](name='changeRequests'),
    }
  ](name='body'),
}

/**
 * @summary 查询研发阶段执行记录集成变更信息
 *
 * @param request ListAppReleaseStageExecutionIntegratedMetadataRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAppReleaseStageExecutionIntegratedMetadataResponse
 */
async function listAppReleaseStageExecutionIntegratedMetadataWithOptions(appName: string, releaseWorkflowSn: string, releaseStageSn: string, executionNumber: string, request: ListAppReleaseStageExecutionIntegratedMetadataRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListAppReleaseStageExecutionIntegratedMetadataResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAppReleaseStageExecutionIntegratedMetadata',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/releaseWorkflows/${OpenApiUtil.getEncodeParam(releaseWorkflowSn)}/releaseStages/${OpenApiUtil.getEncodeParam(releaseStageSn)}/executions/${OpenApiUtil.getEncodeParam(executionNumber)}/integratedMetadata`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'array',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询研发阶段执行记录集成变更信息
 *
 * @param request ListAppReleaseStageExecutionIntegratedMetadataRequest
 * @return ListAppReleaseStageExecutionIntegratedMetadataResponse
 */
async function listAppReleaseStageExecutionIntegratedMetadata(appName: string, releaseWorkflowSn: string, releaseStageSn: string, executionNumber: string, request: ListAppReleaseStageExecutionIntegratedMetadataRequest): ListAppReleaseStageExecutionIntegratedMetadataResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listAppReleaseStageExecutionIntegratedMetadataWithOptions(appName, releaseWorkflowSn, releaseStageSn, executionNumber, request, headers, runtime);
}

model ListAppReleaseStageExecutionsRequest {
  nextToken?: string(name='nextToken', example='""'),
  orderBy?: string(name='orderBy', example='gmtCreate'),
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199fcd'),
  page?: int32(name='page', example='1'),
  pagination?: string(name='pagination', example='keyset'),
  perPage?: int32(name='perPage', example='20'),
  sort?: string(name='sort', example='desc'),
}

model ListAppReleaseStageExecutionsResponseBody = {
  current?: long(name='current', example='1'),
  data?: [ 
    {
      endTime?: string(name='endTime', example='2024-06-25T07:26:18.000+00:00'),
      number?: string(name='number', example='1'),
      startTime?: string(name='startTime', example='2024-06-25T07:25:54.000+00:00'),
      state?: string(name='state', example='SUCCESS'),
      triggerMode?: string(name='triggerMode', example='MANUAL'),
    }
  ](name='data'),
  nextToken?: string(name='nextToken', example='vxc2341gfssad12'),
  pages?: long(name='pages', example='1'),
  perPage?: long(name='perPage', example='20'),
  total?: long(name='total', example='2'),
}

model ListAppReleaseStageExecutionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAppReleaseStageExecutionsResponseBody(name='body'),
}

/**
 * @summary 批量查询研发阶段执行记录
 *
 * @param request ListAppReleaseStageExecutionsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAppReleaseStageExecutionsResponse
 */
async function listAppReleaseStageExecutionsWithOptions(appName: string, releaseWorkflowSn: string, releaseStageSn: string, request: ListAppReleaseStageExecutionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListAppReleaseStageExecutionsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.orderBy)) {
    query['orderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.pagination)) {
    query['pagination'] = request.pagination;
  }
  if (!Util.isUnset(request.perPage)) {
    query['perPage'] = request.perPage;
  }
  if (!Util.isUnset(request.sort)) {
    query['sort'] = request.sort;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAppReleaseStageExecutions',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/releaseWorkflows/${OpenApiUtil.getEncodeParam(releaseWorkflowSn)}/releaseStages/${OpenApiUtil.getEncodeParam(releaseStageSn)}/executions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 批量查询研发阶段执行记录
 *
 * @param request ListAppReleaseStageExecutionsRequest
 * @return ListAppReleaseStageExecutionsResponse
 */
async function listAppReleaseStageExecutions(appName: string, releaseWorkflowSn: string, releaseStageSn: string, request: ListAppReleaseStageExecutionsRequest): ListAppReleaseStageExecutionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listAppReleaseStageExecutionsWithOptions(appName, releaseWorkflowSn, releaseStageSn, request, headers, runtime);
}

model ListApplicationMembersRequest {
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199fcd'),
}

model ListApplicationMembersResponseBody = {
  current?: long(name='current', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  pages?: long(name='pages', example='10'),
  records?: [ 
    {
      avatar?: string(name='avatar', example='http://'),
      description?: string(name='description', example='成语描述'),
      displayName?: string(name='displayName', example='成员1'),
      id?: string(name='id', example='1332695887xxxxxx'),
      roleList?: [ 
        {
          displayName?: string(name='displayName', example='开发者'),
          name?: string(name='name', example='developer'),
        }
      ](name='roleList'),
      type?: string(name='type', example='User'),
    }
  ](name='records'),
  requestId?: string(name='requestId', example='FC93CE1A-8D7A-13A9-8306-7465DE2E5C0F'),
  total?: long(name='total', example='100'),
}

model ListApplicationMembersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListApplicationMembersResponseBody(name='body'),
}

/**
 * @summary 查找应用成员列表
 *
 * @param request ListApplicationMembersRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListApplicationMembersResponse
 */
async function listApplicationMembersWithOptions(appName: string, request: ListApplicationMembersRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListApplicationMembersResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListApplicationMembers',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/members`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查找应用成员列表
 *
 * @param request ListApplicationMembersRequest
 * @return ListApplicationMembersResponse
 */
async function listApplicationMembers(appName: string, request: ListApplicationMembersRequest): ListApplicationMembersResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listApplicationMembersWithOptions(appName, request, headers, runtime);
}

model ListApplicationsRequest {
  nextToken?: string(name='nextToken', example='vxc2341gfssad12'),
  orderBy?: string(name='orderBy', example='asc'),
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199fcd'),
  pagination?: string(name='pagination', example='keyset'),
  perPage?: int32(name='perPage', example='20'),
  sort?: string(name='sort', example='id'),
}

model ListApplicationsResponseBody = {
  data?: [ 
    {
      creatorAccountId?: string(name='creatorAccountId', example='1332695887xxxxxx'),
      description?: string(name='description', example='应用描述'),
      gmtCreate?: string(name='gmtCreate', example='2024-01-01T00:00:00.000+00:00'),
      name?: string(name='name', example='testApp'),
    }
  ](name='data'),
  nextToken?: string(name='nextToken', example='vxc2341gfssad12'),
  requestId?: string(name='requestId', example='FC93CE1A-8D7A-13A9-8306-7465DE2E5C0F'),
}

model ListApplicationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListApplicationsResponseBody(name='body'),
}

/**
 * @summary 分页查找应用详情
 *
 * @param request ListApplicationsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListApplicationsResponse
 */
async function listApplicationsWithOptions(request: ListApplicationsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListApplicationsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.orderBy)) {
    query['orderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.pagination)) {
    query['pagination'] = request.pagination;
  }
  if (!Util.isUnset(request.perPage)) {
    query['perPage'] = request.perPage;
  }
  if (!Util.isUnset(request.sort)) {
    query['sort'] = request.sort;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListApplications',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps%3Asearch`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 分页查找应用详情
 *
 * @param request ListApplicationsRequest
 * @return ListApplicationsResponse
 */
async function listApplications(request: ListApplicationsRequest): ListApplicationsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listApplicationsWithOptions(request, headers, runtime);
}

model ListChangeRequestWorkflowExecutionsRequest {
  orderBy?: string(name='orderBy', example='id'),
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199fcd'),
  page?: long(name='page', example='1'),
  perPage?: long(name='perPage', example='20'),
  releaseStageSn?: string(name='releaseStageSn', description='This parameter is required.', example='e173f3c11db5445eb426ca33c92207c8'),
  releaseWorkflowSn?: string(name='releaseWorkflowSn', description='This parameter is required.', example='ce51b31b996246ecaf874736838360b2'),
  sort?: string(name='sort', example='desc'),
}

model ListChangeRequestWorkflowExecutionsResponseBody = {
  current?: long(name='current', example='1'),
  pageSize?: long(name='pageSize', example='20'),
  pages?: long(name='pages', example='10'),
  records?: [ any ](name='records'),
  total?: long(name='total', example='200'),
}

model ListChangeRequestWorkflowExecutionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListChangeRequestWorkflowExecutionsResponseBody(name='body'),
}

/**
 * @summary 查询变更研发流程运行记录
 *
 * @param request ListChangeRequestWorkflowExecutionsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListChangeRequestWorkflowExecutionsResponse
 */
async function listChangeRequestWorkflowExecutionsWithOptions(appName: string, sn: string, request: ListChangeRequestWorkflowExecutionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListChangeRequestWorkflowExecutionsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.orderBy)) {
    query['orderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.perPage)) {
    query['perPage'] = request.perPage;
  }
  if (!Util.isUnset(request.releaseStageSn)) {
    query['releaseStageSn'] = request.releaseStageSn;
  }
  if (!Util.isUnset(request.releaseWorkflowSn)) {
    query['releaseWorkflowSn'] = request.releaseWorkflowSn;
  }
  if (!Util.isUnset(request.sort)) {
    query['sort'] = request.sort;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListChangeRequestWorkflowExecutions',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/changeRequests/${OpenApiUtil.getEncodeParam(sn)}/executions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询变更研发流程运行记录
 *
 * @param request ListChangeRequestWorkflowExecutionsRequest
 * @return ListChangeRequestWorkflowExecutionsResponse
 */
async function listChangeRequestWorkflowExecutions(appName: string, sn: string, request: ListChangeRequestWorkflowExecutionsRequest): ListChangeRequestWorkflowExecutionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listChangeRequestWorkflowExecutionsWithOptions(appName, sn, request, headers, runtime);
}

model ListChangeRequestsRequest {
  appNameList?: [ string ](name='appNameList'),
  displayNameKeyword?: string(name='displayNameKeyword', example='change1'),
  nextToken?: string(name='nextToken', example='4dc150725770510122396e2476'),
  orderBy?: string(name='orderBy', example='id'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='66c0c9fffeb86b450c199fcd'),
  ownerIdList?: [ string ](name='ownerIdList'),
  page?: int32(name='page', example='1'),
  pagination?: string(name='pagination', example='keyset'),
  perPage?: int32(name='perPage', example='20'),
  sort?: string(name='sort', example='desc'),
  stateList?: [ string ](name='stateList'),
}

model ListChangeRequestsShrinkRequest {
  appNameListShrink?: string(name='appNameList'),
  displayNameKeyword?: string(name='displayNameKeyword', example='change1'),
  nextToken?: string(name='nextToken', example='4dc150725770510122396e2476'),
  orderBy?: string(name='orderBy', example='id'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='66c0c9fffeb86b450c199fcd'),
  ownerIdListShrink?: string(name='ownerIdList'),
  page?: int32(name='page', example='1'),
  pagination?: string(name='pagination', example='keyset'),
  perPage?: int32(name='perPage', example='20'),
  sort?: string(name='sort', example='desc'),
  stateListShrink?: string(name='stateList'),
}

model ListChangeRequestsResponseBody = {
  current?: long(name='current', example='1'),
  data?: [ any ](name='data'),
  nextToken?: string(name='nextToken', example='eb13ac6049d3d78159d60f84af'),
  pages?: long(name='pages', example='5'),
  perPage?: long(name='perPage', example='20'),
  total?: long(name='total', example='100'),
}

model ListChangeRequestsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListChangeRequestsResponseBody(name='body'),
}

/**
 * @summary 查询变更列表
 *
 * @param tmpReq ListChangeRequestsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListChangeRequestsResponse
 */
async function listChangeRequestsWithOptions(appName: string, tmpReq: ListChangeRequestsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListChangeRequestsResponse {
  Util.validateModel(tmpReq);
  var request = new ListChangeRequestsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.appNameList)) {
    request.appNameListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.appNameList, 'appNameList', 'json');
  }
  if (!Util.isUnset(tmpReq.ownerIdList)) {
    request.ownerIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.ownerIdList, 'ownerIdList', 'json');
  }
  if (!Util.isUnset(tmpReq.stateList)) {
    request.stateListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.stateList, 'stateList', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.appNameListShrink)) {
    query['appNameList'] = request.appNameListShrink;
  }
  if (!Util.isUnset(request.displayNameKeyword)) {
    query['displayNameKeyword'] = request.displayNameKeyword;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.orderBy)) {
    query['orderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.ownerIdListShrink)) {
    query['ownerIdList'] = request.ownerIdListShrink;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.pagination)) {
    query['pagination'] = request.pagination;
  }
  if (!Util.isUnset(request.perPage)) {
    query['perPage'] = request.perPage;
  }
  if (!Util.isUnset(request.sort)) {
    query['sort'] = request.sort;
  }
  if (!Util.isUnset(request.stateListShrink)) {
    query['stateList'] = request.stateListShrink;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListChangeRequests',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/changeRequests`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询变更列表
 *
 * @param request ListChangeRequestsRequest
 * @return ListChangeRequestsResponse
 */
async function listChangeRequests(appName: string, request: ListChangeRequestsRequest): ListChangeRequestsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listChangeRequestsWithOptions(appName, request, headers, runtime);
}

model ListCheckRunsRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  page?: long(name='page', example='1'),
  pageSize?: long(name='pageSize', example='20'),
  ref?: string(name='ref', description='This parameter is required.', example='40f4ccfe019cdd4a62d4acb0c57130106fc7e1be'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
}

model ListCheckRunsResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: [ 
    {
      annotations?: [ 
        {
          annotationLevel?: string(name='annotationLevel', example='warning'),
          endColumn?: long(name='endColumn', example='5'),
          endLine?: long(name='endLine', example='2'),
          id?: long(name='id', example='11806'),
          message?: string(name='message'),
          path?: string(name='path', example='demo/test.txt'),
          rawDetails?: string(name='rawDetails'),
          startColumn?: long(name='startColumn', example='3'),
          startLine?: long(name='startLine', example='1'),
          title?: string(name='title'),
        }
      ](name='annotations'),
      checkSuite?: {
        id?: long(name='id', example='1'),
      }(name='checkSuite'),
      completedAt?: string(name='completedAt', example='2023-03-15T08:00:00Z'),
      conclusion?: string(name='conclusion', example='success'),
      createdAt?: string(name='createdAt', example='2022-01-14T21:08:26+08:00'),
      detailsUrl?: string(name='detailsUrl', example='xxx'),
      externalId?: string(name='externalId', example='42'),
      headSha?: string(name='headSha', example='40f4ccfe019cdd4a62d4acb0c57130106fc7e1be'),
      id?: long(name='id', example='1'),
      name?: string(name='name', example='my-check-ci'),
      output?: {
        images?: [ 
          {
            alt?: string(name='alt', example='test-image-alt'),
            caption?: string(name='caption', example='test'),
            imageUrl?: string(name='imageUrl', example='xxx'),
          }
        ](name='images'),
        summary?: string(name='summary'),
        text?: string(name='text'),
        title?: string(name='title', example='Mighty Readme report'),
      }(name='output'),
      startedAt?: string(name='startedAt', example='2023-03-15T08:00:00Z'),
      status?: string(name='status', example='completed'),
      updatedAt?: string(name='updatedAt', example='2022-01-14T21:08:26+08:00'),
      writer?: {
        id?: string(name='id', example='xxx'),
        logoUrl?: string(name='logoUrl', example='xxx'),
        name?: string(name='name', example='test-codeup'),
        slug?: string(name='slug', example='test-codeup'),
        type?: string(name='type', example='User'),
      }(name='writer'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
}

model ListCheckRunsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCheckRunsResponseBody(name='body'),
}

/**
 * @summary 查询检查运行列表
 *
 * @param request ListCheckRunsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCheckRunsResponse
 */
async function listCheckRunsWithOptions(request: ListCheckRunsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListCheckRunsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.ref)) {
    query['ref'] = request.ref;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCheckRuns',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/check_runs/list_check_runs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询检查运行列表
 *
 * @param request ListCheckRunsRequest
 * @return ListCheckRunsResponse
 */
async function listCheckRuns(request: ListCheckRunsRequest): ListCheckRunsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listCheckRunsWithOptions(request, headers, runtime);
}

model ListCommitStatusesRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  page?: long(name='page', example='1'),
  pageSize?: long(name='pageSize', example='20'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
  sha?: string(name='sha', description='This parameter is required.', example='61cc69557962d29f737a91730b3e86f497f083a3'),
}

model ListCommitStatusesResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: [ 
    {
      context?: string(name='context', example='test-commit-status-context'),
      creator?: {
        aliyunPk?: string(name='aliyunPk', example='235671547828975455'),
        avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
        login?: string(name='login', example='codeup'),
        type?: string(name='type', example='User'),
      }(name='creator'),
      description?: string(name='description'),
      id?: long(name='id', example='19285'),
      sha?: string(name='sha', example='61cc69557962d29f737a91730b3e86f497f083a3'),
      state?: string(name='state', example='success'),
      targetUrl?: string(name='targetUrl', example='xxx'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='28'),
}

model ListCommitStatusesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCommitStatusesResponseBody(name='body'),
}

/**
 * @summary 查询提交状态列表
 *
 * @param request ListCommitStatusesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCommitStatusesResponse
 */
async function listCommitStatusesWithOptions(request: ListCommitStatusesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListCommitStatusesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }
  if (!Util.isUnset(request.sha)) {
    query['sha'] = request.sha;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCommitStatuses',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/repository/commit_statuses/list_commit_statuses`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询提交状态列表
 *
 * @param request ListCommitStatusesRequest
 * @return ListCommitStatusesResponse
 */
async function listCommitStatuses(request: ListCommitStatusesRequest): ListCommitStatusesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listCommitStatusesWithOptions(request, headers, runtime);
}

model ListFlowTagGroupsResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  flowTagGroups?: [ 
    {
      creatorAccountId?: string(name='creatorAccountId', example='111111111'),
      id?: long(name='id', example='111'),
      modiferAccountId?: string(name='modiferAccountId', example='11111111'),
      name?: string(name='name', example='标签名称'),
    }
  ](name='flowTagGroups'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model ListFlowTagGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFlowTagGroupsResponseBody(name='body'),
}

/**
 * @summary 获取标签分类列表
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFlowTagGroupsResponse
 */
async function listFlowTagGroupsWithOptions(organizationId: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListFlowTagGroupsResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListFlowTagGroups',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/flow/tagGroups`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取标签分类列表
 *
 * @return ListFlowTagGroupsResponse
 */
async function listFlowTagGroups(organizationId: string): ListFlowTagGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFlowTagGroupsWithOptions(organizationId, headers, runtime);
}

model ListGroupMemberRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='632bbfdf419338aaa2b1360a'),
}

model ListGroupMemberResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='C8F8B434-B006-59FB-8B9C-0382CF3D5680'),
  result?: [ 
    {
      accessLevel?: int32(name='accessLevel', example='30'),
      avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
      email?: string(name='email', example='username@example.com'),
      id?: long(name='id', example='123456'),
      memberType?: string(name='memberType', example='USERS'),
      name?: string(name='name', example='test-codeup'),
      sourceId?: long(name='sourceId', example='223241'),
      state?: string(name='state', example='active'),
      username?: string(name='username', example='test-codeup-nickname'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
}

model ListGroupMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListGroupMemberResponseBody(name='body'),
}

/**
 * @summary 查询组成员列表
 *
 * @param request ListGroupMemberRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListGroupMemberResponse
 */
async function listGroupMemberWithOptions(groupId: string, request: ListGroupMemberRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListGroupMemberResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListGroupMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/groups/${OpenApiUtil.getEncodeParam(groupId)}/list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询组成员列表
 *
 * @param request ListGroupMemberRequest
 * @return ListGroupMemberResponse
 */
async function listGroupMember(groupId: string, request: ListGroupMemberRequest): ListGroupMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listGroupMemberWithOptions(groupId, request, headers, runtime);
}

model ListGroupRepositoriesRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60ee8a814690c27532d412f8'),
  page?: long(name='page', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  search?: string(name='search', example='Demo'),
}

model ListGroupRepositoriesResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='9293CBDA-B5BC-5AD6-A8F4-C7873AC7A3DF'),
  result?: [ 
    {
      archived?: boolean(name='archived', example='false'),
      commitCount?: long(name='commitCount', example='10'),
      createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
      creatorId?: long(name='creatorId', example='19238'),
      description?: string(name='description'),
      httpUrl?: string(name='httpUrl', example='https://xxx/test/test'),
      id?: long(name='id', example='89616'),
      importUrl?: string(name='importUrl', example='http://xxx/x'),
      isStared?: boolean(name='isStared', example='true'),
      issuesEnabled?: boolean(name='issuesEnabled', example='true'),
      lastActivityAt?: string(name='lastActivityAt', example='2022-03-18 14:24:54'),
      mergeRequestsEnabled?: boolean(name='mergeRequestsEnabled', example='true'),
      name?: string(name='name', example='test-group-repo'),
      nameWithNamespace?: string(name='nameWithNamespace'),
      namespaceId?: boolean(name='namespaceId', example='100003'),
      path?: string(name='path', example='test-group-repo'),
      pathWithNamespace?: string(name='pathWithNamespace', example='codeup-test-org/test-group-repo'),
      privateFlag?: boolean(name='privateFlag', example='true'),
      snippetsEnabled?: boolean(name='snippetsEnabled', example='false'),
      sshUrl?: string(name='sshUrl', example='git@xxx:xxx/test/test.git'),
      starCount?: int32(name='starCount', example='0'),
      updatedAt?: string(name='updatedAt', example='2022-03-18 14:24:54'),
      visibilityLevel?: int32(name='visibilityLevel', example='0'),
      webUrl?: string(name='webUrl', example='""'),
      wikiEnabled?: boolean(name='wikiEnabled', example='true'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='2'),
}

model ListGroupRepositoriesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListGroupRepositoriesResponseBody(name='body'),
}

/**
 * @summary 查询代码组下的库列表
 *
 * @param request ListGroupRepositoriesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListGroupRepositoriesResponse
 */
async function listGroupRepositoriesWithOptions(groupId: string, request: ListGroupRepositoriesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListGroupRepositoriesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['search'] = request.search;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListGroupRepositories',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/groups/${OpenApiUtil.getEncodeParam(groupId)}/projects`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询代码组下的库列表
 *
 * @param request ListGroupRepositoriesRequest
 * @return ListGroupRepositoriesResponse
 */
async function listGroupRepositories(groupId: string, request: ListGroupRepositoriesRequest): ListGroupRepositoriesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listGroupRepositoriesWithOptions(groupId, request, headers, runtime);
}

model ListHostGroupsRequest {
  createEndTime?: long(name='createEndTime', example='1586863220000'),
  createStartTime?: long(name='createStartTime', example='1586863220000'),
  creatorAccountIds?: string(name='creatorAccountIds', example='1112122121,3223332'),
  ids?: string(name='ids', example='121,1212121232'),
  maxResults?: long(name='maxResults', example='30'),
  name?: string(name='name', example='主机组'),
  nextToken?: string(name='nextToken', example='221212221'),
  pageOrder?: string(name='pageOrder', example='DESC'),
  pageSort?: string(name='pageSort', example='ID'),
}

model ListHostGroupsResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  hostGroups?: [ 
    {
      aliyunRegion?: string(name='aliyunRegion', example='cn-beijing'),
      createTime?: long(name='createTime', example='1586863220000'),
      creatorAccountId?: string(name='creatorAccountId', example='2222222222222'),
      description?: string(name='description', example='主机组'),
      ecsLabelKey?: string(name='ecsLabelKey', example='ecs'),
      ecsLabelValue?: string(name='ecsLabelValue', example='value'),
      ecsType?: string(name='ecsType', example='ECS_ALIYUN'),
      hostNum?: long(name='hostNum', example='3'),
      id?: long(name='id', description='323232', example='部署组Id'),
      modifierAccountId?: string(name='modifierAccountId', example='211111111'),
      name?: string(name='name', example='部署组'),
      serviceConnectionId?: long(name='serviceConnectionId', example='1212122'),
      type?: string(name='type', example='ECS'),
      updateTime?: long(name='updateTime', example='1586863220000'),
    }
  ](name='hostGroups'),
  nextToken?: string(name='nextToken', example='asassasassa'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  totalCount?: long(name='totalCount', example='50'),
}

model ListHostGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHostGroupsResponseBody(name='body'),
}

/**
 * @summary 获取主机组列表
 *
 * @param request ListHostGroupsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHostGroupsResponse
 */
async function listHostGroupsWithOptions(organizationId: string, request: ListHostGroupsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListHostGroupsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.createEndTime)) {
    query['createEndTime'] = request.createEndTime;
  }
  if (!Util.isUnset(request.createStartTime)) {
    query['createStartTime'] = request.createStartTime;
  }
  if (!Util.isUnset(request.creatorAccountIds)) {
    query['creatorAccountIds'] = request.creatorAccountIds;
  }
  if (!Util.isUnset(request.ids)) {
    query['ids'] = request.ids;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.name)) {
    query['name'] = request.name;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.pageOrder)) {
    query['pageOrder'] = request.pageOrder;
  }
  if (!Util.isUnset(request.pageSort)) {
    query['pageSort'] = request.pageSort;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListHostGroups',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/hostGroups`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取主机组列表
 *
 * @param request ListHostGroupsRequest
 * @return ListHostGroupsResponse
 */
async function listHostGroups(organizationId: string, request: ListHostGroupsRequest): ListHostGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listHostGroupsWithOptions(organizationId, request, headers, runtime);
}

model ListJoinedOrganizationsResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='”“'),
  organizations?: [ 
    {
      id?: string(name='id', example='65f25d0fa54c216dcf6b1dbd'),
      isOrgAdmin?: boolean(name='isOrgAdmin'),
      name?: string(name='name'),
    }
  ](name='organizations'),
  requestId?: string(name='requestId', example='11D0EE6E-5803-5D4C-A652-E672BE1F3D8E'),
  success?: boolean(name='success', example='true'),
}

model ListJoinedOrganizationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListJoinedOrganizationsResponseBody(name='body'),
}

/**
 * @summary 当前用户加入的企业列表
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListJoinedOrganizationsResponse
 */
async function listJoinedOrganizationsWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): ListJoinedOrganizationsResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListJoinedOrganizations',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/users/joinedOrgs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 当前用户加入的企业列表
 *
 * @return ListJoinedOrganizationsResponse
 */
async function listJoinedOrganizations(): ListJoinedOrganizationsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listJoinedOrganizationsWithOptions(headers, runtime);
}

model ListMergeRequestCommentsRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  commentType?: string(name='commentType', example='GLOBAL_COMMENT'),
  filePath?: string(name='filePath', example='/src/main/test.java'),
  patchSetBizIds?: [ string ](name='patchSetBizIds'),
  resolved?: boolean(name='resolved', example='false'),
  state?: string(name='state', example='OPENED'),
  localId?: long(name='localId', description='This parameter is required.', example='10'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
}

model ListMergeRequestCommentsResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='56C33A95-C04F-59F0-B3CD-E2A2EB9FADBB'),
  result?: [ 
    {
      author?: {
        aliyunPk?: string(name='aliyunPk', example='284692704493684695'),
        avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
        email?: string(name='email', example='username@example.com'),
        id?: long(name='id'),
        name?: string(name='name', example='codeup'),
        state?: string(name='state', example='active'),
        username?: string(name='username', example='test-codeup'),
      }(name='author'),
      childComments?: [ 
        {
          author?: {
            aliyunPk?: string(name='aliyunPk', example='204485087002425236'),
            avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
            email?: string(name='email', example='username@example.com'),
            id?: long(name='id'),
            name?: string(name='name', example='codeup'),
            state?: string(name='state', example='active'),
            username?: string(name='username', example='test-codeup'),
          }(name='author'),
          commentBizId?: string(name='commentBizId', example='63f0e293357f48f9846ddc4dbbebd0e3'),
          commentTime?: string(name='commentTime', example='2022-03-18 14:24:54'),
          commentType?: string(name='commentType', example='GLOBAL_COMMENT'),
          content?: string(name='content'),
          deleted?: boolean(name='deleted', example='false'),
          filePath?: string(name='filePath', example='src/main/test.java'),
          finalChildComments?: [ 
            {
              author?: {
                aliyunPk?: string(name='aliyunPk', example='235671547828975455'),
                avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
                email?: string(name='email', example='username@example.com'),
                id?: long(name='id'),
                name?: string(name='name', example='codeup'),
                state?: string(name='state', example='active'),
                username?: string(name='username', example='test-codeup'),
              }(name='author'),
              commentBizId?: string(name='commentBizId', example='5c399e3685e542a28db16d93e9f82abb'),
              commentTime?: string(name='commentTime', example='2022-03-18 14:24:54'),
              commentType?: string(name='commentType', example='GLOBAL_COMMENT'),
              content?: string(name='content'),
              deleted?: boolean(name='deleted', example='false'),
              filePath?: string(name='filePath', example='src/main/test.java'),
              lastEditTime?: string(name='lastEditTime', example='2022-03-18 14:24:54'),
              lineNumber?: string(name='lineNumber', example='3'),
              parentCommentBizId?: string(name='parentCommentBizId', example='4c5dcec6a8dc41e69c369737dadc1841'),
              relatedPatchSet?: {
                commitId?: string(name='commitId', example='1a072f5367c21f9de3464b8c0ee8546e47764d2d'),
                createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
                patchSetBizId?: string(name='patchSetBizId', example='513fcfd81a9142d2bb0db4f72c0aa15b'),
                patchSetName?: string(name='patchSetName'),
                patchSetNo?: string(name='patchSetNo', example='1'),
                relatedMergeItemType?: string(name='relatedMergeItemType', example='MERGE_SOURCE'),
                shortId?: string(name='shortId', example='1a072f53'),
              }(name='relatedPatchSet'),
              resolved?: boolean(name='resolved', example='false'),
              rootCommentBizId?: string(name='rootCommentBizId', example='dcf2b23cebfc418f98dbd35e423d9fd3'),
              state?: string(name='state', example='OPENED'),
            }
          ](name='finalChildComments'),
          lastEditTime?: string(name='lastEditTime', example='2022-03-18 14:24:54'),
          lineNumber?: string(name='lineNumber', example='3'),
          parentCommentBizId?: string(name='parentCommentBizId', example='5c399e3685e542a28db16d93e9f82abb'),
          relatedPatchSet?: {
            commitId?: string(name='commitId', example='1a072f5367c21f9de3464b8c0ee8546e47764d2d'),
            createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
            patchSetBizId?: string(name='patchSetBizId', example='513fcfd81a9142d2bb0db4f72c0aa15b'),
            patchSetName?: string(name='patchSetName'),
            patchSetNo?: string(name='patchSetNo', example='1'),
            relatedMergeItemType?: string(name='relatedMergeItemType', example='MERGE_SOURCE'),
            shortId?: string(name='shortId', example='1a072f53'),
          }(name='relatedPatchSet'),
          resolved?: boolean(name='resolved', example='false'),
          rootCommentBizId?: string(name='rootCommentBizId', example='dcf2b23cebfc418f98dbd35e423d9fd3'),
          state?: string(name='state', example='OPENED'),
        }
      ](name='childComments'),
      commentBizId?: string(name='commentBizId', example='5c399e3685e542a28db16d93e9f82abb'),
      commentTime?: string(name='commentTime', example='2022-03-18 14:24:54'),
      commentType?: string(name='commentType', example='GLOBAL_COMMENT'),
      content?: string(name='content'),
      deleted?: boolean(name='deleted', example='false'),
      filePath?: string(name='filePath', example='src/main/test.java'),
      lastEditTime?: string(name='lastEditTime', example='2022-03-18 14:24:54'),
      lineNumber?: string(name='lineNumber', example='3'),
      parentCommentBizId?: string(name='parentCommentBizId', example='4c5dcec6a8dc41e69c369737dadc1841'),
      relatedPatchSet?: {
        commitId?: string(name='commitId', example='1a072f5367c21f9de3464b8c0ee8546e47764d2d'),
        createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
        patchSetBizId?: string(name='patchSetBizId', example='513fcfd81a9142d2bb0db4f72c0aa15b'),
        patchSetName?: string(name='patchSetName'),
        patchSetNo?: string(name='patchSetNo', example='1'),
        relatedMergeItemType?: string(name='relatedMergeItemType', example='MERGE_SOURCE'),
        shortId?: string(name='shortId', example='1a072f53'),
      }(name='relatedPatchSet'),
      resolved?: boolean(name='resolved', example='false'),
      rootCommentBizId?: string(name='rootCommentBizId', example='dcf2b23cebfc418f98dbd35e423d9fd3'),
      state?: string(name='state', example='OPENED'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
}

model ListMergeRequestCommentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMergeRequestCommentsResponseBody(name='body'),
}

/**
 * @summary 查询合并请求评论列表
 *
 * @param request ListMergeRequestCommentsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMergeRequestCommentsResponse
 */
async function listMergeRequestCommentsWithOptions(request: ListMergeRequestCommentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListMergeRequestCommentsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.localId)) {
    query['localId'] = request.localId;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.commentType)) {
    body['commentType'] = request.commentType;
  }
  if (!Util.isUnset(request.filePath)) {
    body['filePath'] = request.filePath;
  }
  if (!Util.isUnset(request.patchSetBizIds)) {
    body['patchSetBizIds'] = request.patchSetBizIds;
  }
  if (!Util.isUnset(request.resolved)) {
    body['resolved'] = request.resolved;
  }
  if (!Util.isUnset(request.state)) {
    body['state'] = request.state;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListMergeRequestComments',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/merge_requests/comments/list_comments`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询合并请求评论列表
 *
 * @param request ListMergeRequestCommentsRequest
 * @return ListMergeRequestCommentsResponse
 */
async function listMergeRequestComments(request: ListMergeRequestCommentsRequest): ListMergeRequestCommentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listMergeRequestCommentsWithOptions(request, headers, runtime);
}

model ListMergeRequestFilesReadsRequest {
  accessToken?: string(name='accessToken', example='agp_4d57a6796b3626f52064ab1fba5384a5'),
  fromPatchSetBizId?: string(name='fromPatchSetBizId', description='This parameter is required.', example='5e733626d53f4b04a6aa0e23d4ff72b8'),
  localId?: long(name='localId', description='This parameter is required.', example='5'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
  toPatchSetBizId?: string(name='toPatchSetBizId', description='This parameter is required.', example='513fcfd81a9142d2bb0db4f72c0aa15b'),
}

model ListMergeRequestFilesReadsResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: [ 
    {
      deletedFile?: string(name='deletedFile', example='false'),
      newFile?: boolean(name='newFile', example='true'),
      newFilePath?: string(name='newFilePath', example='text.txt'),
      oldFilePath?: string(name='oldFilePath', example='text.txt'),
      readUsers?: [ 
        {
          aliyunPk?: string(name='aliyunPk', example='204485087002425236'),
          avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
          email?: string(name='email', example='username@example.com'),
          name?: string(name='name', example='codeup'),
          state?: string(name='state', example='active'),
          username?: string(name='username', example='test-codeup'),
        }
      ](name='readUsers'),
      renamedFile?: string(name='renamedFile', example='false'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
}

model ListMergeRequestFilesReadsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMergeRequestFilesReadsResponseBody(name='body'),
}

/**
 * @summary 查询合并请求文件已读列表
 *
 * @param request ListMergeRequestFilesReadsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMergeRequestFilesReadsResponse
 */
async function listMergeRequestFilesReadsWithOptions(request: ListMergeRequestFilesReadsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListMergeRequestFilesReadsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.fromPatchSetBizId)) {
    query['fromPatchSetBizId'] = request.fromPatchSetBizId;
  }
  if (!Util.isUnset(request.localId)) {
    query['localId'] = request.localId;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }
  if (!Util.isUnset(request.toPatchSetBizId)) {
    query['toPatchSetBizId'] = request.toPatchSetBizId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListMergeRequestFilesReads',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/merge_requests/diffs/files_read_infos`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询合并请求文件已读列表
 *
 * @param request ListMergeRequestFilesReadsRequest
 * @return ListMergeRequestFilesReadsResponse
 */
async function listMergeRequestFilesReads(request: ListMergeRequestFilesReadsRequest): ListMergeRequestFilesReadsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listMergeRequestFilesReadsWithOptions(request, headers, runtime);
}

model ListMergeRequestLabelsRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  localId?: long(name='localId', description='This parameter is required.', example='1'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
}

model ListMergeRequestLabelsResponseBody = {
  errorCode?: string(name='errorCode', example='Invalid.IdNotFound'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='4D6AF7CC-B43B-5454-86AB-023D25E44868'),
  result?: [ 
    {
      color?: string(name='color', example='#A16AD7'),
      description?: string(name='description'),
      id?: string(name='id', example='f2bf0e0b4ce34a348b2d971c69a1d11f'),
      name?: string(name='name'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
}

model ListMergeRequestLabelsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMergeRequestLabelsResponseBody(name='body'),
}

/**
 * @summary 查询合并请求Label列表
 *
 * @param request ListMergeRequestLabelsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMergeRequestLabelsResponse
 */
async function listMergeRequestLabelsWithOptions(request: ListMergeRequestLabelsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListMergeRequestLabelsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.localId)) {
    query['localId'] = request.localId;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListMergeRequestLabels',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/merge_requests/labels`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询合并请求Label列表
 *
 * @param request ListMergeRequestLabelsRequest
 * @return ListMergeRequestLabelsResponse
 */
async function listMergeRequestLabels(request: ListMergeRequestLabelsRequest): ListMergeRequestLabelsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listMergeRequestLabelsWithOptions(request, headers, runtime);
}

model ListMergeRequestPatchSetsRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  localId?: long(name='localId', description='This parameter is required.', example='4'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
}

model ListMergeRequestPatchSetsResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: [ 
    {
      commitId?: string(name='commitId', example='1a072f5367c21f9de3464b8c0ee8546e47764d2d'),
      createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
      patchSetBizId?: string(name='patchSetBizId', example='513fcfd81a9142d2bb0db4f72c0aa15b'),
      patchSetName?: string(name='patchSetName'),
      patchSetNo?: long(name='patchSetNo', example='1'),
      relatedMergeItemType?: string(name='relatedMergeItemType', example='MERGE_SOURCE'),
      shortCommitId?: string(name='shortCommitId', example='1a072f53'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
}

model ListMergeRequestPatchSetsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMergeRequestPatchSetsResponseBody(name='body'),
}

/**
 * @summary 查询合并请求的版本列表
 *
 * @param request ListMergeRequestPatchSetsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMergeRequestPatchSetsResponse
 */
async function listMergeRequestPatchSetsWithOptions(request: ListMergeRequestPatchSetsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListMergeRequestPatchSetsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.localId)) {
    query['localId'] = request.localId;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListMergeRequestPatchSets',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/merge_requests/diffs/list_patchsets`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询合并请求的版本列表
 *
 * @param request ListMergeRequestPatchSetsRequest
 * @return ListMergeRequestPatchSetsResponse
 */
async function listMergeRequestPatchSets(request: ListMergeRequestPatchSetsRequest): ListMergeRequestPatchSetsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listMergeRequestPatchSetsWithOptions(request, headers, runtime);
}

model ListMergeRequestsRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  authorIds?: string(name='authorIds', example='1234567890'),
  createdAfter?: string(name='createdAfter'),
  createdBefore?: string(name='createdBefore'),
  filter?: string(name='filter', example='new'),
  groupIds?: string(name='groupIds', example='889910, 889911'),
  labelIds?: string(name='labelIds'),
  orderBy?: string(name='orderBy', example='updated_at'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
  page?: long(name='page', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  projectIds?: string(name='projectIds', example='2308912, 2308913'),
  reviewerIds?: string(name='reviewerIds', example='1234567890123'),
  search?: string(name='search', example='test-search'),
  sort?: string(name='sort', example='desc'),
  state?: string(name='state', example='opened'),
}

model ListMergeRequestsResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', description='Id of the request', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: [ 
    {
      author?: {
        avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
        email?: string(name='email', example='username@example.com'),
        id?: long(name='id', example='19927'),
        name?: string(name='name', example='test-codeup'),
        state?: string(name='state', example='active'),
        username?: string(name='username', example='root-test-codeup'),
      }(name='author'),
      createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
      creationMethod?: string(name='creationMethod', example='WEB'),
      description?: string(name='description'),
      detailUrl?: string(name='detailUrl', example='xxx'),
      id?: long(name='id', example='1'),
      iid?: long(name='iid', example='1'),
      labels?: [ 
        {
          color?: string(name='color'),
          description?: string(name='description'),
          id?: string(name='id'),
          name?: string(name='name'),
        }
      ](name='labels'),
      localId?: long(name='localId', example='2'),
      mergedRevision?: string(name='mergedRevision'),
      mrBizId?: string(name='mrBizId', example='bca90244c4b749e0b109df52ac0eb570'),
      nameWithNamespace?: string(name='nameWithNamespace'),
      newMergeRequestIdentifier?: boolean(name='newMergeRequestIdentifier', example='true'),
      newVersionState?: string(name='newVersionState', example='UNDER_REVIEW'),
      projectId?: long(name='projectId', example='2369234'),
      reviewers?: [ 
        {
          avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
          email?: string(name='email', example='username@example.com'),
          hasCommented?: boolean(name='hasCommented'),
          hasReviewed?: boolean(name='hasReviewed'),
          id?: long(name='id', example='43127'),
          name?: string(name='name', example='test-review-user'),
          reviewOpinionStatus?: string(name='reviewOpinionStatus'),
          reviewTime?: string(name='reviewTime'),
          state?: string(name='state', example='active'),
          status?: string(name='status', example='approved'),
          username?: string(name='username', example='root-test-review-user'),
        }
      ](name='reviewers'),
      sourceBranch?: string(name='sourceBranch', example='test-merge-source-branch'),
      sourceProjectId?: long(name='sourceProjectId', example='2876119'),
      sourceType?: string(name='sourceType', example='BRANCH'),
      sshUrl?: string(name='sshUrl', example='git@xxx:xxx/test/test.git'),
      state?: string(name='state', example='opened'),
      subscribers?: [ 
        {
          avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
          email?: string(name='email', example='username@example.com'),
          id?: long(name='id', example='1876119'),
          name?: string(name='name', example='test-subscriber'),
          state?: string(name='state', example='active'),
          username?: string(name='username', example='root-test-subscriber'),
        }
      ](name='subscribers'),
      supportMergeFFOnly?: boolean(name='supportMergeFFOnly', example='true'),
      targetBranch?: string(name='targetBranch', example='test-merge-target-branch'),
      targetProjectId?: long(name='targetProjectId', example='2876119'),
      targetType?: string(name='targetType', example='BRANCH'),
      title?: string(name='title'),
      updatedAt?: string(name='updatedAt', example='2022-03-18 14:24:54'),
      webUrl?: string(name='webUrl', example='""'),
      workInProgress?: boolean(name='workInProgress', example='false'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='30'),
}

model ListMergeRequestsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMergeRequestsResponseBody(name='body'),
}

/**
 * @summary 查询代码评审列表
 *
 * @param request ListMergeRequestsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMergeRequestsResponse
 */
async function listMergeRequestsWithOptions(request: ListMergeRequestsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListMergeRequestsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.authorIds)) {
    query['authorIds'] = request.authorIds;
  }
  if (!Util.isUnset(request.createdAfter)) {
    query['createdAfter'] = request.createdAfter;
  }
  if (!Util.isUnset(request.createdBefore)) {
    query['createdBefore'] = request.createdBefore;
  }
  if (!Util.isUnset(request.filter)) {
    query['filter'] = request.filter;
  }
  if (!Util.isUnset(request.groupIds)) {
    query['groupIds'] = request.groupIds;
  }
  if (!Util.isUnset(request.labelIds)) {
    query['labelIds'] = request.labelIds;
  }
  if (!Util.isUnset(request.orderBy)) {
    query['orderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectIds)) {
    query['projectIds'] = request.projectIds;
  }
  if (!Util.isUnset(request.reviewerIds)) {
    query['reviewerIds'] = request.reviewerIds;
  }
  if (!Util.isUnset(request.search)) {
    query['search'] = request.search;
  }
  if (!Util.isUnset(request.sort)) {
    query['sort'] = request.sort;
  }
  if (!Util.isUnset(request.state)) {
    query['state'] = request.state;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListMergeRequests',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/merge_requests/advanced_search`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询代码评审列表
 *
 * @param request ListMergeRequestsRequest
 * @return ListMergeRequestsResponse
 */
async function listMergeRequests(request: ListMergeRequestsRequest): ListMergeRequestsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listMergeRequestsWithOptions(request, headers, runtime);
}

model ListOrganizationMembersRequest {
  containsExternInfo?: boolean(name='containsExternInfo', description='返回信息中是否包含第三方信息，默认不包含。'),
  externUid?: string(name='externUid', example='1236666'),
  joinTimeFrom?: long(name='joinTimeFrom', example='1631845101798'),
  joinTimeTo?: long(name='joinTimeTo', example='1631845101798'),
  maxResults?: long(name='maxResults', example='20'),
  nextToken?: string(name='nextToken', example='""'),
  organizationMemberName?: string(name='organizationMemberName'),
  provider?: string(name='provider', example='Dingtalk'),
  state?: string(name='state', example='normal'),
}

model ListOrganizationMembersResponseBody = {
  errorCode?: string(name='errorCode', example='null'),
  errorMessage?: string(name='errorMessage', example='error info'),
  members?: [ 
    {
      accountId?: string(name='accountId', example='123456677888'),
      birthday?: long(name='birthday', example='1631845101798'),
      deptLists?: [ string ](name='deptLists'),
      email?: string(name='email', example='(敏感字段，暂不返回)'),
      hiredDate?: long(name='hiredDate', example='1631845101798'),
      identities?: {
        externUid?: string(name='externUid', example='1236666'),
        provider?: string(name='provider', example='Dingtalk'),
      }(name='identities'),
      jobNumber?: string(name='jobNumber', example='373***'),
      joinTime?: long(name='joinTime', example='1631845101798'),
      lastVisitTime?: long(name='lastVisitTime', example='1631845101798'),
      mobile?: string(name='mobile', example='(敏感字段，暂不返回)'),
      organizationMemberName?: string(name='organizationMemberName'),
      organizationRoleId?: string(name='organizationRoleId', example='8fc0c9ff039711dd64acd000'),
      organizationRoleName?: string(name='organizationRoleName'),
      state?: string(name='state', example='normal'),
    }
  ](name='members'),
  nextToken?: string(name='nextToken', example='""'),
  requestId?: string(name='requestId', example='FC93CE1A-8D7A-13A9-8306-7465DE2E5C0F'),
  success?: boolean(name='success', example='true'),
  totalCount?: long(name='totalCount', example='15'),
}

model ListOrganizationMembersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListOrganizationMembersResponseBody(name='body'),
}

/**
 * @summary 获取企业成员列表
 *
 * @param request ListOrganizationMembersRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListOrganizationMembersResponse
 */
async function listOrganizationMembersWithOptions(organizationId: string, request: ListOrganizationMembersRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListOrganizationMembersResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.containsExternInfo)) {
    query['containsExternInfo'] = request.containsExternInfo;
  }
  if (!Util.isUnset(request.externUid)) {
    query['externUid'] = request.externUid;
  }
  if (!Util.isUnset(request.joinTimeFrom)) {
    query['joinTimeFrom'] = request.joinTimeFrom;
  }
  if (!Util.isUnset(request.joinTimeTo)) {
    query['joinTimeTo'] = request.joinTimeTo;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.organizationMemberName)) {
    query['organizationMemberName'] = request.organizationMemberName;
  }
  if (!Util.isUnset(request.provider)) {
    query['provider'] = request.provider;
  }
  if (!Util.isUnset(request.state)) {
    query['state'] = request.state;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOrganizationMembers',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/members`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取企业成员列表
 *
 * @param request ListOrganizationMembersRequest
 * @return ListOrganizationMembersResponse
 */
async function listOrganizationMembers(organizationId: string, request: ListOrganizationMembersRequest): ListOrganizationMembersResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listOrganizationMembersWithOptions(organizationId, request, headers, runtime);
}

model ListOrganizationsRequest {
  accessLevel?: int32(name='accessLevel', example='5'),
  accessToken?: string(name='accessToken'),
  minAccessLevel?: int32(name='minAccessLevel', example='60'),
}

model ListOrganizationsResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='95FE5953-FF5B-5F80-94AD-FFF97D990FE0'),
  result?: [ 
    {
      accessLevel?: int32(name='accessLevel', example='60'),
      id?: long(name='id', example='5240'),
      namespaceId?: string(name='namespaceId'),
      organizationAlias?: string(name='organizationAlias'),
      organizationId?: string(name='organizationId', example='60de7a6852743a5162b5f957'),
      organizationName?: string(name='organizationName'),
      organizationRole?: string(name='organizationRole', example='ORG_ADMIN'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='2'),
}

model ListOrganizationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListOrganizationsResponseBody(name='body'),
}

/**
 * @summary 查询用户企业列表
 *
 * @param request ListOrganizationsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListOrganizationsResponse
 */
async function listOrganizationsWithOptions(request: ListOrganizationsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListOrganizationsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessLevel)) {
    query['accessLevel'] = request.accessLevel;
  }
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.minAccessLevel)) {
    query['minAccessLevel'] = request.minAccessLevel;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOrganizations',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organizations/list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询用户企业列表
 *
 * @param request ListOrganizationsRequest
 * @return ListOrganizationsResponse
 */
async function listOrganizations(request: ListOrganizationsRequest): ListOrganizationsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listOrganizationsWithOptions(request, headers, runtime);
}

model ListPipelineGroupPipelinesRequest {
  createEndTime?: long(name='createEndTime', example='1586863220000'),
  createStartTime?: long(name='createStartTime', example='1586863220000'),
  executeEndTime?: long(name='executeEndTime', example='1586863220000'),
  executeStartTime?: long(name='executeStartTime', example='1586863220000'),
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='aaaa'),
  pipelineName?: string(name='pipelineName'),
  resultStatusList?: string(name='resultStatusList', example='RUNNING,SUCCESS'),
}

model ListPipelineGroupPipelinesResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  nextToken?: string(name='nextToken', example='aaaa'),
  pipelines?: [ 
    {
      createTime?: long(name='createTime', example='1586863220000'),
      pipelineId?: long(name='pipelineId', example='1111'),
      pipelineName?: string(name='pipelineName'),
    }
  ](name='pipelines'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  totalCount?: int32(name='totalCount', example='20'),
}

model ListPipelineGroupPipelinesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPipelineGroupPipelinesResponseBody(name='body'),
}

/**
 * @summary 获取流水线分组下流水线列表列表
 *
 * @param request ListPipelineGroupPipelinesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPipelineGroupPipelinesResponse
 */
async function listPipelineGroupPipelinesWithOptions(organizationId: string, groupId: string, request: ListPipelineGroupPipelinesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListPipelineGroupPipelinesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.createEndTime)) {
    query['createEndTime'] = request.createEndTime;
  }
  if (!Util.isUnset(request.createStartTime)) {
    query['createStartTime'] = request.createStartTime;
  }
  if (!Util.isUnset(request.executeEndTime)) {
    query['executeEndTime'] = request.executeEndTime;
  }
  if (!Util.isUnset(request.executeStartTime)) {
    query['executeStartTime'] = request.executeStartTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.pipelineName)) {
    query['pipelineName'] = request.pipelineName;
  }
  if (!Util.isUnset(request.resultStatusList)) {
    query['resultStatusList'] = request.resultStatusList;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPipelineGroupPipelines',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelineGroups/${OpenApiUtil.getEncodeParam(groupId)}/pipelines`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流水线分组下流水线列表列表
 *
 * @param request ListPipelineGroupPipelinesRequest
 * @return ListPipelineGroupPipelinesResponse
 */
async function listPipelineGroupPipelines(organizationId: string, groupId: string, request: ListPipelineGroupPipelinesRequest): ListPipelineGroupPipelinesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listPipelineGroupPipelinesWithOptions(organizationId, groupId, request, headers, runtime);
}

model ListPipelineGroupsRequest {
  maxResults?: long(name='maxResults', example='20'),
  nextToken?: string(name='nextToken', example='aaaaaaaaaa'),
}

model ListPipelineGroupsResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  nextToken?: string(name='nextToken', example='ssaassasass'),
  pipelineGroups?: [ 
    {
      createTime?: long(name='createTime', example='1586863220000'),
      id?: long(name='id', example='111'),
      name?: string(name='name'),
    }
  ](name='pipelineGroups'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  totalCount?: int32(name='totalCount', example='50'),
}

model ListPipelineGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPipelineGroupsResponseBody(name='body'),
}

/**
 * @summary 获取流水线分组列表
 *
 * @param request ListPipelineGroupsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPipelineGroupsResponse
 */
async function listPipelineGroupsWithOptions(organizationId: string, request: ListPipelineGroupsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListPipelineGroupsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.maxResults)) {
    query['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPipelineGroups',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelineGroups`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流水线分组列表
 *
 * @param request ListPipelineGroupsRequest
 * @return ListPipelineGroupsResponse
 */
async function listPipelineGroups(organizationId: string, request: ListPipelineGroupsRequest): ListPipelineGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listPipelineGroupsWithOptions(organizationId, request, headers, runtime);
}

model ListPipelineJobHistorysRequest {
  category?: string(name='category', description='This parameter is required.', example='DEPLOY'),
  identifier?: string(name='identifier', description='This parameter is required.', example='10_ssasasa'),
  maxResults?: long(name='maxResults', description='This parameter is required.', example='10'),
  nextToken?: string(name='nextToken', example='xsaxsa'),
}

model ListPipelineJobHistorysResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  jobs?: [ 
    {
      executeNumber?: int32(name='executeNumber', example='1'),
      identifier?: string(name='identifier', example='10_xaxxsxa'),
      jobId?: long(name='jobId', example='123'),
      jobName?: string(name='jobName'),
      operatorAccountId?: string(name='operatorAccountId', example='ssaasssa'),
      pipelineId?: long(name='pipelineId', example='123'),
      pipelineRunId?: long(name='pipelineRunId', example='123'),
      sources?: string(name='sources', example='{}'),
      status?: string(name='status', example='SUCCESS'),
    }
  ](name='jobs'),
  nextToken?: string(name='nextToken', example='xsxxs'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
  totalCount?: int32(name='totalCount', example='20'),
}

model ListPipelineJobHistorysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPipelineJobHistorysResponseBody(name='body'),
}

/**
 * @summary 获取流水线运行过的任务历史
 *
 * @param request ListPipelineJobHistorysRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPipelineJobHistorysResponse
 */
async function listPipelineJobHistorysWithOptions(organizationId: string, pipelineId: string, request: ListPipelineJobHistorysRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListPipelineJobHistorysResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.category)) {
    query['category'] = request.category;
  }
  if (!Util.isUnset(request.identifier)) {
    query['identifier'] = request.identifier;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPipelineJobHistorys',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipeline/${OpenApiUtil.getEncodeParam(pipelineId)}/job/historys`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流水线运行过的任务历史
 *
 * @param request ListPipelineJobHistorysRequest
 * @return ListPipelineJobHistorysResponse
 */
async function listPipelineJobHistorys(organizationId: string, pipelineId: string, request: ListPipelineJobHistorysRequest): ListPipelineJobHistorysResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listPipelineJobHistorysWithOptions(organizationId, pipelineId, request, headers, runtime);
}

model ListPipelineJobsRequest {
  category?: string(name='category', description='This parameter is required.', example='DEPLOY'),
}

model ListPipelineJobsResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  jobs?: [ 
    {
      identifier?: string(name='identifier', example='ss_saxsxsxs'),
      jobName?: string(name='jobName'),
      lastJobId?: long(name='lastJobId', example='123'),
      lastJobParams?: string(name='lastJobParams', example='{}'),
    }
  ](name='jobs'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model ListPipelineJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPipelineJobsResponseBody(name='body'),
}

/**
 * @summary 获取流水线运行过的任务
 *
 * @param request ListPipelineJobsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPipelineJobsResponse
 */
async function listPipelineJobsWithOptions(organizationId: string, pipelineId: string, request: ListPipelineJobsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListPipelineJobsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.category)) {
    query['category'] = request.category;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPipelineJobs',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipeline/${OpenApiUtil.getEncodeParam(pipelineId)}/jobs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流水线运行过的任务
 *
 * @param request ListPipelineJobsRequest
 * @return ListPipelineJobsResponse
 */
async function listPipelineJobs(organizationId: string, pipelineId: string, request: ListPipelineJobsRequest): ListPipelineJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listPipelineJobsWithOptions(organizationId, pipelineId, request, headers, runtime);
}

model ListPipelineRelationsRequest {
  relObjectType?: string(name='relObjectType', description='This parameter is required.', example='VARIABLE_GROUP'),
}

model ListPipelineRelationsResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  pipelineRelations?: [ 
    {
      refObjectId?: long(name='refObjectId', example='12234'),
    }
  ](name='pipelineRelations'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model ListPipelineRelationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPipelineRelationsResponseBody(name='body'),
}

/**
 * @summary 获取流水线关联列表
 *
 * @param request ListPipelineRelationsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPipelineRelationsResponse
 */
async function listPipelineRelationsWithOptions(organizationId: string, pipelineId: string, request: ListPipelineRelationsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListPipelineRelationsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.relObjectType)) {
    query['relObjectType'] = request.relObjectType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPipelineRelations',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/${OpenApiUtil.getEncodeParam(pipelineId)}/pipelineRelations`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流水线关联列表
 *
 * @param request ListPipelineRelationsRequest
 * @return ListPipelineRelationsResponse
 */
async function listPipelineRelations(organizationId: string, pipelineId: string, request: ListPipelineRelationsRequest): ListPipelineRelationsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listPipelineRelationsWithOptions(organizationId, pipelineId, request, headers, runtime);
}

model ListPipelineRunsRequest {
  endTime?: long(name='endTime', example='1586863220000'),
  maxResults?: long(name='maxResults', example='20'),
  nextToken?: string(name='nextToken', example='aaaaaa'),
  startTime?: long(name='startTime', example='1586863220000'),
  status?: string(name='status', example='RUNNING'),
  triggerMode?: int32(name='triggerMode', example='1'),
}

model ListPipelineRunsResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  nextToken?: string(name='nextToken', example='xzxsasasaas'),
  pipelineRuns?: [ 
    {
      creatorAccountId?: string(name='creatorAccountId', example='1222222222'),
      endTime?: long(name='endTime', example='1586863220000'),
      pipelineId?: long(name='pipelineId', example='1234'),
      pipelineRunId?: long(name='pipelineRunId', example='11'),
      startTime?: long(name='startTime', example='1586863220000'),
      status?: string(name='status', example='状态 FAIL 运行失败 SUCCESS 运行成功 RUNNING 运行中'),
      triggerMode?: long(name='triggerMode', example='1'),
    }
  ](name='pipelineRuns'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  totalCount?: long(name='totalCount', example='50'),
}

model ListPipelineRunsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPipelineRunsResponseBody(name='body'),
}

/**
 * @summary 获取流水线运行历史
 *
 * @param request ListPipelineRunsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPipelineRunsResponse
 */
async function listPipelineRunsWithOptions(organizationId: string, pipelineId: string, request: ListPipelineRunsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListPipelineRunsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    query['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    query['startTime'] = request.startTime;
  }
  if (!Util.isUnset(request.status)) {
    query['status'] = request.status;
  }
  if (!Util.isUnset(request.triggerMode)) {
    query['triggerMode'] = request.triggerMode;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPipelineRuns',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/pipelineRuns`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流水线运行历史
 *
 * @param request ListPipelineRunsRequest
 * @return ListPipelineRunsResponse
 */
async function listPipelineRuns(organizationId: string, pipelineId: string, request: ListPipelineRunsRequest): ListPipelineRunsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listPipelineRunsWithOptions(organizationId, pipelineId, request, headers, runtime);
}

model ListPipelinesRequest {
  createEndTime?: long(name='createEndTime', example='1586863220000'),
  createStartTime?: long(name='createStartTime', example='1586863220000'),
  creatorAccountIds?: string(name='creatorAccountIds', example='112122121'),
  executeAccountIds?: string(name='executeAccountIds', example='1111111'),
  executeEndTime?: long(name='executeEndTime', example='1586863220000'),
  executeStartTime?: long(name='executeStartTime', example='1586863220000'),
  maxResults?: long(name='maxResults', example='20'),
  nextToken?: string(name='nextToken', example='aaaaaaaaaa'),
  pipelineName?: string(name='pipelineName', example='流水线'),
  statusList?: string(name='statusList', example='RUNNING,SUCCESS'),
}

model ListPipelinesResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  nextToken?: string(name='nextToken', example='ssaassasass'),
  pipelines?: [ 
    {
      createTime?: long(name='createTime', example='1586863220000'),
      creatorAccountId?: string(name='creatorAccountId', example='22121222'),
      groupId?: long(name='groupId'),
      pipelineId?: long(name='pipelineId', example='124'),
      pipelineName?: string(name='pipelineName', example='流水线'),
    }
  ](name='pipelines'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  totalCount?: long(name='totalCount', example='50'),
}

model ListPipelinesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPipelinesResponseBody(name='body'),
}

/**
 * @summary 获取流水线列表
 *
 * @param request ListPipelinesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPipelinesResponse
 */
async function listPipelinesWithOptions(organizationId: string, request: ListPipelinesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListPipelinesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.createEndTime)) {
    query['createEndTime'] = request.createEndTime;
  }
  if (!Util.isUnset(request.createStartTime)) {
    query['createStartTime'] = request.createStartTime;
  }
  if (!Util.isUnset(request.creatorAccountIds)) {
    query['creatorAccountIds'] = request.creatorAccountIds;
  }
  if (!Util.isUnset(request.executeAccountIds)) {
    query['executeAccountIds'] = request.executeAccountIds;
  }
  if (!Util.isUnset(request.executeEndTime)) {
    query['executeEndTime'] = request.executeEndTime;
  }
  if (!Util.isUnset(request.executeStartTime)) {
    query['executeStartTime'] = request.executeStartTime;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.pipelineName)) {
    query['pipelineName'] = request.pipelineName;
  }
  if (!Util.isUnset(request.statusList)) {
    query['statusList'] = request.statusList;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPipelines',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流水线列表
 *
 * @param request ListPipelinesRequest
 * @return ListPipelinesResponse
 */
async function listPipelines(organizationId: string, request: ListPipelinesRequest): ListPipelinesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listPipelinesWithOptions(organizationId, request, headers, runtime);
}

model ListProjectLabelsRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  orderBy?: string(name='orderBy', example='label_name'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  page?: int32(name='page', example='1'),
  pageSize?: long(name='pageSize', example='20'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
  search?: string(name='search', example='TEST'),
  sort?: string(name='sort', example='desc'),
  withCounts?: boolean(name='withCounts', example='false'),
}

model ListProjectLabelsResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: [ 
    {
      color?: string(name='color', example='#A16AD7'),
      description?: string(name='description'),
      id?: string(name='id', example='f2bf0e0b4ce34a348b2d971c69a1d11f'),
      name?: string(name='name'),
      openMergeRequestsCount?: long(name='openMergeRequestsCount', example='1'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='30'),
}

model ListProjectLabelsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectLabelsResponseBody(name='body'),
}

/**
 * @summary 查询代码库Label列表
 *
 * @param request ListProjectLabelsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectLabelsResponse
 */
async function listProjectLabelsWithOptions(request: ListProjectLabelsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProjectLabelsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.orderBy)) {
    query['orderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }
  if (!Util.isUnset(request.search)) {
    query['search'] = request.search;
  }
  if (!Util.isUnset(request.sort)) {
    query['sort'] = request.sort;
  }
  if (!Util.isUnset(request.withCounts)) {
    query['withCounts'] = request.withCounts;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProjectLabels',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/labels`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询代码库Label列表
 *
 * @param request ListProjectLabelsRequest
 * @return ListProjectLabelsResponse
 */
async function listProjectLabels(request: ListProjectLabelsRequest): ListProjectLabelsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProjectLabelsWithOptions(request, headers, runtime);
}

model ListProjectMembersRequest {
  targetType?: string(name='targetType', description='This parameter is required.', example='Space'),
}

model ListProjectMembersResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  members?: [ 
    {
      account?: string(name='account', example='null'),
      avatar?: string(name='avatar', example='https://xxxxxx.png'),
      dingTalkId?: string(name='dingTalkId', example='null'),
      displayName?: string(name='displayName', example='名称'),
      displayNickName?: string(name='displayNickName', example='mingcheng'),
      displayRealName?: string(name='displayRealName', example='名称'),
      division?: {
        identifier?: string(name='identifier', example='1345xxxxxxx947xxxx'),
      }(name='division'),
      email?: string(name='email', example='accountsxxxx@mail.com'),
      gender?: string(name='gender', example='null'),
      identifier?: string(name='identifier', example='19xxxx31947xxxx'),
      mobile?: string(name='mobile', example='135xxxxxxxxx'),
      nameEn?: string(name='nameEn', example='name'),
      nickName?: string(name='nickName', example='昵称'),
      nickNamePinyin?: string(name='nickNamePinyin', example='nicheng'),
      organizationUserInfo?: {
        organizationIdentifier?: string(name='organizationIdentifier', example='5e7xxxxb3cd3711dd6xxx2c'),
      }(name='organizationUserInfo'),
      realName?: string(name='realName', example='xxx'),
      realNamePinyin?: string(name='realNamePinyin', example='xxx'),
      roleName?: string(name='roleName', description='角色名称'),
      stamp?: string(name='stamp', example='User'),
      tbRoleId?: string(name='tbRoleId', example='null'),
    }
  ](name='members'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model ListProjectMembersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectMembersResponseBody(name='body'),
}

/**
 * @summary 根据项目id获取项目所以成员
 *
 * @param request ListProjectMembersRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectMembersResponse
 */
async function listProjectMembersWithOptions(organizationId: string, projectId: string, request: ListProjectMembersRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProjectMembersResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.targetType)) {
    query['targetType'] = request.targetType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProjectMembers',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/projects/${OpenApiUtil.getEncodeParam(projectId)}/listMembers`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 根据项目id获取项目所以成员
 *
 * @param request ListProjectMembersRequest
 * @return ListProjectMembersResponse
 */
async function listProjectMembers(organizationId: string, projectId: string, request: ListProjectMembersRequest): ListProjectMembersResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProjectMembersWithOptions(organizationId, projectId, request, headers, runtime);
}

model ListProjectTemplatesRequest {
  category?: string(name='category', description='This parameter is required.', example='Project'),
}

model ListProjectTemplatesResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  templates?: [ 
    {
      copyFrom?: string(name='copyFrom', example='null'),
      creator?: string(name='creator', example='19xx7043xxxxxxx914'),
      description?: string(name='description', example='迭代的具体信息'),
      gmtCreate?: long(name='gmtCreate', example='1623916393000'),
      gmtModified?: long(name='gmtModified', example='1623916393000'),
      icon?: string(name='icon', example='https://img.xxxx.png'),
      identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
      modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
      name?: string(name='name', example='专用模板'),
      nameEn?: string(name='nameEn', example='Test Template'),
      resourceCategory?: string(name='resourceCategory', example='Project'),
      resourceType?: string(name='resourceType', example='null'),
      spaceIdentifier?: string(name='spaceIdentifier', example='null'),
      spaceType?: string(name='spaceType', example='null'),
      type?: long(name='type', example='4'),
    }
  ](name='templates'),
}

model ListProjectTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectTemplatesResponseBody(name='body'),
}

/**
 * @summary 获取项目模板列表
 *
 * @param request ListProjectTemplatesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectTemplatesResponse
 */
async function listProjectTemplatesWithOptions(organizationId: string, request: ListProjectTemplatesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProjectTemplatesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.category)) {
    query['category'] = request.category;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProjectTemplates',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/projects/listTemplates`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取项目模板列表
 *
 * @param request ListProjectTemplatesRequest
 * @return ListProjectTemplatesResponse
 */
async function listProjectTemplates(organizationId: string, request: ListProjectTemplatesRequest): ListProjectTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProjectTemplatesWithOptions(organizationId, request, headers, runtime);
}

model ListProjectWorkitemTypesRequest {
  category?: string(name='category', description='This parameter is required.', example='Req'),
  spaceType?: string(name='spaceType', description='This parameter is required.', example='Project'),
}

model ListProjectWorkitemTypesResponseBody = {
  errorCode?: string(name='errorCode', example='例：Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='errormessage'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true或者false'),
  workitemTypes?: [ 
    {
      addUser?: string(name='addUser', example='用户阿里云pk，例如19xxxx31947xxxx'),
      categoryIdentifier?: string(name='categoryIdentifier', example='Req'),
      creator?: string(name='creator', example='用户阿里云pk，例如19xxxx31947xxxx'),
      defaultType?: boolean(name='defaultType', example='true或者false'),
      description?: string(name='description', example='该类型的具体信息'),
      enable?: boolean(name='enable', example='true或者false'),
      gmtAdd?: long(name='gmtAdd', example='1641870287000'),
      gmtCreate?: long(name='gmtCreate', example='1620455467000'),
      identifier?: string(name='identifier', example='dfexxxxxf4fee18xxxxx36'),
      name?: string(name='name', example='例：业务类需求'),
      nameEn?: string(name='nameEn', example='例：Business Requirement'),
      systemDefault?: boolean(name='systemDefault', example='true'),
    }
  ](name='workitemTypes'),
}

model ListProjectWorkitemTypesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectWorkitemTypesResponseBody(name='body'),
}

/**
 * @summary 获取项目下开启的工作项类型
 *
 * @param request ListProjectWorkitemTypesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectWorkitemTypesResponse
 */
async function listProjectWorkitemTypesWithOptions(organizationId: string, projectId: string, request: ListProjectWorkitemTypesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProjectWorkitemTypesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.category)) {
    query['category'] = request.category;
  }
  if (!Util.isUnset(request.spaceType)) {
    query['spaceType'] = request.spaceType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProjectWorkitemTypes',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/projects/${OpenApiUtil.getEncodeParam(projectId)}/getWorkitemType`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取项目下开启的工作项类型
 *
 * @param request ListProjectWorkitemTypesRequest
 * @return ListProjectWorkitemTypesResponse
 */
async function listProjectWorkitemTypes(organizationId: string, projectId: string, request: ListProjectWorkitemTypesRequest): ListProjectWorkitemTypesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProjectWorkitemTypesWithOptions(organizationId, projectId, request, headers, runtime);
}

model ListProjectsRequest {
  category?: string(name='category', description='This parameter is required.', example='Project'),
  conditions?: string(name='conditions', description='{"conditionGroups":[[]]}'),
  extraConditions?: string(name='extraConditions'),
  maxResults?: long(name='maxResults', example='20'),
  nextToken?: string(name='nextToken', example='""'),
  scope?: string(name='scope', example='public'),
}

model ListProjectsResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  maxResults?: long(name='maxResults', example='20'),
  nextToken?: string(name='nextToken', example='""'),
  projects?: [ 
    {
      categoryIdentifier?: string(name='categoryIdentifier', example='Project'),
      creator?: string(name='creator', example='19xx7043xxxxxxx914'),
      customCode?: string(name='customCode', example='OJAY'),
      deleteTime?: long(name='deleteTime', example='null'),
      description?: string(name='description', example='xxx'),
      gmtCreate?: long(name='gmtCreate', example='1640778694000'),
      icon?: string(name='icon', example='https://xxxxxx.png'),
      identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
      logicalStatus?: string(name='logicalStatus', example='null'),
      name?: string(name='name', example='xxxx'),
      scope?: string(name='scope', example='public'),
      statusStageIdentifier?: string(name='statusStageIdentifier', example='null'),
      typeIdentifier?: string(name='typeIdentifier', example='null'),
    }
  ](name='projects'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  totalCount?: long(name='totalCount', example='10'),
}

model ListProjectsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectsResponseBody(name='body'),
}

/**
 * @summary 获取项目列表
 *
 * @param request ListProjectsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectsResponse
 */
async function listProjectsWithOptions(organizationId: string, request: ListProjectsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProjectsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.category)) {
    query['category'] = request.category;
  }
  if (!Util.isUnset(request.conditions)) {
    query['conditions'] = request.conditions;
  }
  if (!Util.isUnset(request.extraConditions)) {
    query['extraConditions'] = request.extraConditions;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.scope)) {
    query['scope'] = request.scope;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProjects',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/listProjects`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取项目列表
 *
 * @param request ListProjectsRequest
 * @return ListProjectsResponse
 */
async function listProjects(organizationId: string, request: ListProjectsRequest): ListProjectsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProjectsWithOptions(organizationId, request, headers, runtime);
}

model ListProtectedBranchesRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model ListProtectedBranchesResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='313A1BF6-63B7-52D4-A098-952221A65254'),
  result?: [ 
    {
      allowMergeRoles?: [ int32 ](name='allowMergeRoles'),
      allowMergeUserIds?: [ long ](name='allowMergeUserIds'),
      allowMergeUsers?: [ 
        {
          avatar?: string(name='avatar', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
          email?: string(name='email', example='username@example.com'),
          id?: long(name='id', example='19238'),
          name?: string(name='name'),
          username?: string(name='username', example='codeup-test'),
        }
      ](name='allowMergeUsers'),
      allowPushRoles?: [ int32 ](name='allowPushRoles'),
      allowPushUserIds?: [ long ](name='allowPushUserIds'),
      allowPushUsers?: [ 
        {
          avatar?: string(name='avatar', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
          email?: string(name='email', example='username@example.com'),
          id?: long(name='id', example='19238'),
          name?: string(name='name'),
          username?: string(name='username', example='codeup-test'),
        }
      ](name='allowPushUsers'),
      branch?: string(name='branch', example='protectedBranch'),
      createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
      id?: long(name='id', example='19285'),
      matches?: [ string ](name='matches'),
      mergeRequestSetting?: {
        allowMergeRequestRoles?: [ int32 ](name='allowMergeRequestRoles'),
        defaultAssignees?: [ 
          {
            avatar?: string(name='avatar', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
            email?: string(name='email', example='username@example.com'),
            id?: long(name='id', example='19238'),
            name?: string(name='name'),
            username?: string(name='username', example='codeup-test'),
          }
        ](name='defaultAssignees'),
        isAllowSelfApproval?: boolean(name='isAllowSelfApproval', example='true'),
        isRequireDiscussionProcessed?: boolean(name='isRequireDiscussionProcessed', example='true'),
        isRequired?: boolean(name='isRequired', example='true'),
        isResetApprovalWhenNewPush?: boolean(name='isResetApprovalWhenNewPush', example='false'),
        minimumApproval?: int32(name='minimumApproval', example='1'),
        mrMode?: string(name='mrMode', example='general'),
        whiteList?: string(name='whiteList', example='**.java'),
      }(name='mergeRequestSetting'),
      testSettingDTO?: {
        checkConfig?: {
          checkItems?: [ 
            {
              isRequired?: boolean(name='isRequired', example='false'),
              name?: string(name='name'),
            }
          ](name='checkItems'),
        }(name='checkConfig'),
        checkTaskQualityConfig?: {
          bizNo?: string(name='bizNo', example='123456'),
          enabled?: boolean(name='enabled', example='false'),
          message?: string(name='message', example='test_task_quality'),
          taskName?: string(name='taskName', example='biz-task-quality'),
        }(name='checkTaskQualityConfig'),
        codeGuidelinesDetection?: {
          enabled?: boolean(name='enabled', example='false'),
          message?: string(name='message', example='test_code_guide_lines'),
        }(name='codeGuidelinesDetection'),
        isRequired?: boolean(name='isRequired', example='false'),
        sensitiveInfoDetection?: {
          enabled?: boolean(name='enabled', example='false'),
          message?: string(name='message', example='test_code_sensitive_info'),
        }(name='sensitiveInfoDetection'),
      }(name='testSettingDTO'),
      updatedAt?: string(name='updatedAt', example='2022-03-18 14:24:54'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
}

model ListProtectedBranchesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProtectedBranchesResponseBody(name='body'),
}

/**
 * @summary 查询保护分支列表
 *
 * @param request ListProtectedBranchesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProtectedBranchesResponse
 */
async function listProtectedBranchesWithOptions(repositoryId: string, request: ListProtectedBranchesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProtectedBranchesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProtectedBranches',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/protect_branches`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询保护分支列表
 *
 * @param request ListProtectedBranchesRequest
 * @return ListProtectedBranchesResponse
 */
async function listProtectedBranches(repositoryId: string, request: ListProtectedBranchesRequest): ListProtectedBranchesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProtectedBranchesWithOptions(repositoryId, request, headers, runtime);
}

model ListPushRulesRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60d54f3daccf2bbd6659f3ad'),
}

model ListPushRulesResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: [ 
    {
      gmtCreate?: string(name='gmtCreate', example='2023-09-03T18:20:06+08:00'),
      gmtModified?: string(name='gmtModified', example='2023-09-03T18:20:06+08:00'),
      id?: long(name='id', example='2077'),
      ruleInfos?: [ 
        {
          checkerName?: string(name='checkerName', example='CommitFilesChecker'),
          checkerType?: string(name='checkerType', example='warn'),
          extraMessage?: string(name='extraMessage', example='""'),
          fileRuleRegexes?: [ string ](name='fileRuleRegexes'),
        }
      ](name='ruleInfos'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='2'),
}

model ListPushRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPushRulesResponseBody(name='body'),
}

/**
 * @summary 查询推送规则列表
 *
 * @param request ListPushRulesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPushRulesResponse
 */
async function listPushRulesWithOptions(repositoryId: string, request: ListPushRulesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListPushRulesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPushRules',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/${OpenApiUtil.getEncodeParam(repositoryId)}/push_rule/push_rules/list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询推送规则列表
 *
 * @param request ListPushRulesRequest
 * @return ListPushRulesResponse
 */
async function listPushRules(repositoryId: string, request: ListPushRulesRequest): ListPushRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listPushRulesWithOptions(repositoryId, request, headers, runtime);
}

model ListRepositoriesRequest {
  accessToken?: string(name='accessToken'),
  archived?: boolean(name='archived', example='false'),
  minAccessLevel?: int32(name='minAccessLevel'),
  orderBy?: string(name='orderBy', example='created_at'),
  organizationId?: string(name='organizationId', description='This parameter is required.'),
  page?: long(name='page', example='2'),
  perPage?: long(name='perPage', example='20'),
  search?: string(name='search', example='Demo'),
  sort?: string(name='sort', example='desc'),
}

model ListRepositoriesResponseBody = {
  errorCode?: int32(name='errorCode'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='4D6AF7CC-B43B-5454-86AB-023D25E44868'),
  result?: [ 
    {
      id?: long(name='Id', example='1'),
      accessLevel?: int32(name='accessLevel', example='40'),
      archive?: boolean(name='archive', example='false'),
      avatarUrl?: string(name='avatarUrl'),
      createdAt?: string(name='createdAt', example='2022-01-14T21:08:26+08:00'),
      description?: string(name='description'),
      importStatus?: string(name='importStatus'),
      lastActivityAt?: string(name='lastActivityAt', example='2022-01-14T21:08:26+08:00'),
      name?: string(name='name', example='codeupTest'),
      nameWithNamespace?: string(name='nameWithNamespace'),
      namespaceId?: long(name='namespaceId', example='745'),
      path?: string(name='path', example='test-codeup'),
      pathWithNamespace?: string(name='pathWithNamespace', example='codeup-test-org/test-codeup'),
      star?: boolean(name='star', example='false'),
      starCount?: long(name='starCount', example='0'),
      updatedAt?: string(name='updatedAt', example='2022-01-14T21:08:26+08:00'),
      visibilityLevel?: string(name='visibilityLevel', example='0'),
      webUrl?: string(name='webUrl', example='""'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='149'),
}

model ListRepositoriesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRepositoriesResponseBody(name='body'),
}

/**
 * @summary 查询代码库列表
 *
 * @param request ListRepositoriesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRepositoriesResponse
 */
async function listRepositoriesWithOptions(request: ListRepositoriesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListRepositoriesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.archived)) {
    query['archived'] = request.archived;
  }
  if (!Util.isUnset(request.minAccessLevel)) {
    query['minAccessLevel'] = request.minAccessLevel;
  }
  if (!Util.isUnset(request.orderBy)) {
    query['orderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.perPage)) {
    query['perPage'] = request.perPage;
  }
  if (!Util.isUnset(request.search)) {
    query['search'] = request.search;
  }
  if (!Util.isUnset(request.sort)) {
    query['sort'] = request.sort;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRepositories',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询代码库列表
 *
 * @param request ListRepositoriesRequest
 * @return ListRepositoriesResponse
 */
async function listRepositories(request: ListRepositoriesRequest): ListRepositoriesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listRepositoriesWithOptions(request, headers, runtime);
}

model ListRepositoryBranchesRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
  page?: long(name='page', example='1'),
  pageSize?: long(name='pageSize', example='20'),
  search?: string(name='search', example='Demo'),
  sort?: string(name='sort', example='desc'),
}

model ListRepositoryBranchesResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='1F4F342D-493A-5B2C-B133-BA78B30FF834'),
  result?: [ 
    {
      commit?: {
        authorEmail?: string(name='authorEmail', example='username@example.com'),
        authorName?: string(name='authorName', example='test-codeup'),
        authoredDate?: string(name='authoredDate', example='2022-03-18 10:00:00'),
        committedDate?: string(name='committedDate', example='2022-03-18 11:00:00'),
        committerEmail?: string(name='committerEmail', example='username@example.com'),
        committerName?: string(name='committerName', example='commit-codeup'),
        createdAt?: string(name='createdAt', example='2022-03-18 10:00:00'),
        id?: string(name='id', example='de02b625ba8488f92eb204bcb3773a40c1b4ddac'),
        message?: string(name='message'),
        parentIds?: [ string ](name='parentIds'),
        shortId?: string(name='shortId', example='e0297d8f'),
        title?: string(name='title'),
      }(name='commit'),
      name?: string(name='name', example='testBranch'),
      protected?: string(name='protected', example='false'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='100'),
}

model ListRepositoryBranchesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRepositoryBranchesResponseBody(name='body'),
}

/**
 * @summary 查询分支列表
 *
 * @param request ListRepositoryBranchesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRepositoryBranchesResponse
 */
async function listRepositoryBranchesWithOptions(repositoryId: string, request: ListRepositoryBranchesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListRepositoryBranchesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['search'] = request.search;
  }
  if (!Util.isUnset(request.sort)) {
    query['sort'] = request.sort;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRepositoryBranches',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/branches`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询分支列表
 *
 * @param request ListRepositoryBranchesRequest
 * @return ListRepositoryBranchesResponse
 */
async function listRepositoryBranches(repositoryId: string, request: ListRepositoryBranchesRequest): ListRepositoryBranchesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listRepositoryBranchesWithOptions(repositoryId, request, headers, runtime);
}

model ListRepositoryCommitDiffRequest {
  accessToken?: string(name='accessToken', description='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  contextLine?: int32(name='contextLine', example='3'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model ListRepositoryCommitDiffResponseBody = {
  errorCode?: string(name='errorCode', example='success'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', description='Id of the request', example='0EE38A4E-8991-532A-8E8B-5C22B5D2E058'),
  result?: [ 
    {
      aMode?: string(name='aMode', example='100644'),
      bMode?: string(name='bMode', example='100755'),
      deletedFile?: boolean(name='deletedFile'),
      diff?: string(name='diff', example='--- /dev/null\\\\n+++ b/src/test/java/com/aliyun/codeupdemo/CodeupDemoApplicationTests.java\\\\n@@ -0,0 +1,13 @@\\\\n+package com.aliyun.codeupdemo;\\\\n+\\\\n+import org.junit.jupiter.api.Test;\\\\n+import org.springframework.boot.test.context.SpringBootTest;\\\\n+\\\\n+@SpringBootTest\\\\n+class CodeupDemoApplicationTest {\\\\n+\\\\n+ @Test\\\\n+ void contextLoads() {\\\\n+ }\\\\n+\\\\n+}\\\\n'),
      isBinary?: boolean(name='isBinary'),
      isNewLfs?: boolean(name='isNewLfs'),
      isOldLfs?: boolean(name='isOldLfs'),
      newFile?: boolean(name='newFile'),
      newId?: string(name='newId', example='6c268061a546378276559c713d0ad377d4xxxxxx'),
      newPath?: string(name='newPath', example='src/test/java/com/aliyun/codeupdemo/CodeupDemoApplicationTests.java'),
      oldId?: string(name='oldId', example='0000000000000000000000000000000000000000'),
      oldPath?: string(name='oldPath', example='src/test/java/com/aliyun/codeupdemo/CodeupDemoApplicationTests.java'),
      renamedFile?: boolean(name='renamedFile'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
}

model ListRepositoryCommitDiffResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRepositoryCommitDiffResponseBody(name='body'),
}

/**
 * @summary 查询代码库单个提交（Commit）的提交内容
 *
 * @param request ListRepositoryCommitDiffRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRepositoryCommitDiffResponse
 */
async function listRepositoryCommitDiffWithOptions(repositoryId: string, sha: string, request: ListRepositoryCommitDiffRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListRepositoryCommitDiffResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.contextLine)) {
    query['contextLine'] = request.contextLine;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRepositoryCommitDiff',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/commits/${OpenApiUtil.getEncodeParam(sha)}/diff`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询代码库单个提交（Commit）的提交内容
 *
 * @param request ListRepositoryCommitDiffRequest
 * @return ListRepositoryCommitDiffResponse
 */
async function listRepositoryCommitDiff(repositoryId: string, sha: string, request: ListRepositoryCommitDiffRequest): ListRepositoryCommitDiffResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listRepositoryCommitDiffWithOptions(repositoryId, sha, request, headers, runtime);
}

model ListRepositoryCommitsRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  end?: string(name='end', example='2022-08-18 08:00:00'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
  page?: long(name='page', example='1'),
  pageSize?: long(name='pageSize', example='20'),
  path?: string(name='path', example='src/cpp/main.cpp'),
  refName?: string(name='refName', description='This parameter is required.'),
  search?: string(name='search', example='search'),
  showCommentsCount?: boolean(name='showCommentsCount', example='false'),
  showSignature?: boolean(name='showSignature', example='false'),
  start?: string(name='start', example='2022-03-18 08:00:00'),
}

model ListRepositoryCommitsResponseBody = {
  errorCode?: string(name='errorCode', example='OpenApi.error'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F1138237-CF7F-56BF-95D4-9AA937CCE8E5'),
  result?: [ 
    {
      author?: {
        avatarUrl?: string(name='avatarUrl'),
        email?: string(name='email', example='username@example.com'),
        id?: long(name='id', example='7914'),
        name?: string(name='name'),
        state?: string(name='state', example='active'),
        username?: string(name='username', example='nickname'),
        websiteUrl?: string(name='websiteUrl', example='""'),
      }(name='author'),
      authorEmail?: string(name='authorEmail', example='username@example.com'),
      authorName?: string(name='authorName', example='test-codeup'),
      authoredDate?: string(name='authoredDate', example='2022-03-18 15:00:00'),
      commentsCount?: long(name='commentsCount', example='1'),
      committedDate?: string(name='committedDate', example='2022-03-18 16:00:00'),
      committer?: {
        avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
        email?: string(name='email', example='username@example.com'),
        id?: long(name='id', example='41031'),
        name?: string(name='name', example='committer-codeup'),
        state?: string(name='state', example='active'),
        username?: string(name='username', example='nickname'),
        websiteUrl?: string(name='websiteUrl', example='""'),
      }(name='committer'),
      committerEmail?: string(name='committerEmail', example='username@example.com'),
      committerName?: string(name='committerName', example='committer-codeup'),
      createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
      id?: string(name='id', example='de02b625ba8488f92eb204bcb3773a40c1b4ddac'),
      message?: string(name='message'),
      parentIds?: [ string ](name='parentIds'),
      shortId?: string(name='shortId', example='de02b625'),
      signature?: {
        gpgKeyId?: string(name='gpgKeyId', example='”“'),
        verificationStatus?: string(name='verificationStatus', example='verified'),
      }(name='signature'),
      title?: string(name='title'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='145'),
}

model ListRepositoryCommitsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRepositoryCommitsResponseBody(name='body'),
}

/**
 * @summary 查询代码库提交历史
 *
 * @param request ListRepositoryCommitsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRepositoryCommitsResponse
 */
async function listRepositoryCommitsWithOptions(repositoryId: string, request: ListRepositoryCommitsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListRepositoryCommitsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.end)) {
    query['end'] = request.end;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.path)) {
    query['path'] = request.path;
  }
  if (!Util.isUnset(request.refName)) {
    query['refName'] = request.refName;
  }
  if (!Util.isUnset(request.search)) {
    query['search'] = request.search;
  }
  if (!Util.isUnset(request.showCommentsCount)) {
    query['showCommentsCount'] = request.showCommentsCount;
  }
  if (!Util.isUnset(request.showSignature)) {
    query['showSignature'] = request.showSignature;
  }
  if (!Util.isUnset(request.start)) {
    query['start'] = request.start;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRepositoryCommits',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/commits`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询代码库提交历史
 *
 * @param request ListRepositoryCommitsRequest
 * @return ListRepositoryCommitsResponse
 */
async function listRepositoryCommits(repositoryId: string, request: ListRepositoryCommitsRequest): ListRepositoryCommitsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listRepositoryCommitsWithOptions(repositoryId, request, headers, runtime);
}

model ListRepositoryGroupsRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  includePersonal?: boolean(name='includePersonal', example='false'),
  orderBy?: string(name='orderBy', example='updated_at'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
  page?: long(name='page', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  parentId?: long(name='parentId', description='This parameter is required.', example='26842'),
  search?: string(name='search', example='Demo'),
  sort?: string(name='sort', example='desc'),
}

model ListRepositoryGroupsResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: [ 
    {
      accessLevel?: int32(name='accessLevel', example='40'),
      avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
      createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
      description?: string(name='description'),
      groupCount?: long(name='groupCount', example='10'),
      id?: long(name='id', example='19285'),
      name?: string(name='name', example='test-codeup'),
      nameWithNamespace?: string(name='nameWithNamespace'),
      ownerId?: long(name='ownerId', example='19230'),
      parentId?: long(name='parentId', example='26842'),
      path?: string(name='path', example='test-codeup'),
      pathWithNamespace?: string(name='pathWithNamespace', example='60de7a6852743a5162b5f957/test-codeup'),
      projectCount?: long(name='projectCount', example='10'),
      type?: string(name='type', example='Group'),
      updatedAt?: string(name='updatedAt', example='2022-03-18 14:24:54'),
      visibilityLevel?: int32(name='visibilityLevel', example='0'),
      webUrl?: string(name='webUrl', example='""'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='100'),
}

model ListRepositoryGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRepositoryGroupsResponseBody(name='body'),
}

/**
 * @summary 查询代码组列表
 *
 * @param request ListRepositoryGroupsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRepositoryGroupsResponse
 */
async function listRepositoryGroupsWithOptions(request: ListRepositoryGroupsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListRepositoryGroupsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.includePersonal)) {
    query['includePersonal'] = request.includePersonal;
  }
  if (!Util.isUnset(request.orderBy)) {
    query['orderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.parentId)) {
    query['parentId'] = request.parentId;
  }
  if (!Util.isUnset(request.search)) {
    query['search'] = request.search;
  }
  if (!Util.isUnset(request.sort)) {
    query['sort'] = request.sort;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRepositoryGroups',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/groups/get/all`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询代码组列表
 *
 * @param request ListRepositoryGroupsRequest
 * @return ListRepositoryGroupsResponse
 */
async function listRepositoryGroups(request: ListRepositoryGroupsRequest): ListRepositoryGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listRepositoryGroupsWithOptions(request, headers, runtime);
}

model ListRepositoryMemberWithInheritedRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.'),
}

model ListRepositoryMemberWithInheritedResponseBody = {
  errorCode?: string(name='errorCode'),
  errorMessage?: string(name='errorMessage'),
  requestId?: string(name='requestId'),
  result?: [ 
    {
      accessLevel?: int32(name='accessLevel'),
      avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
      email?: string(name='email'),
      id?: long(name='id'),
      inherited?: {
        id?: long(name='id', description='id'),
        name?: string(name='name', example='codeup'),
        nameWithNamespace?: string(name='nameWithNamespace'),
        path?: string(name='path', example='codeup'),
        pathWithNamespace?: string(name='pathWithNamespace'),
        type?: string(name='type'),
        visibilityLevel?: string(name='visibilityLevel', example='0'),
      }(name='inherited'),
      name?: string(name='name', example='codeup'),
      state?: string(name='state', example='active'),
      username?: string(name='username', example='yunxiao'),
    }
  ](name='result'),
  success?: boolean(name='success'),
}

model ListRepositoryMemberWithInheritedResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRepositoryMemberWithInheritedResponseBody(name='body'),
}

/**
 * @summary 查询代码库成员列表
 *
 * @param request ListRepositoryMemberWithInheritedRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRepositoryMemberWithInheritedResponse
 */
async function listRepositoryMemberWithInheritedWithOptions(repositoryId: string, request: ListRepositoryMemberWithInheritedRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListRepositoryMemberWithInheritedResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRepositoryMemberWithInherited',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/members/list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询代码库成员列表
 *
 * @param request ListRepositoryMemberWithInheritedRequest
 * @return ListRepositoryMemberWithInheritedResponse
 */
async function listRepositoryMemberWithInherited(repositoryId: string, request: ListRepositoryMemberWithInheritedRequest): ListRepositoryMemberWithInheritedResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listRepositoryMemberWithInheritedWithOptions(repositoryId, request, headers, runtime);
}

model ListRepositoryTagsRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='611b75680fc7bf0dbe1dce55'),
  page?: long(name='page', example='2'),
  pageSize?: long(name='pageSize', example='10'),
  search?: string(name='search', example='Demo'),
  sort?: string(name='sort', example='updated_desc'),
}

model ListRepositoryTagsResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: [ 
    {
      commit?: {
        authorEmail?: string(name='authorEmail', example='username@example.com'),
        authorName?: string(name='authorName'),
        authoredDate?: string(name='authoredDate', example='2022-03-18 10:00:00'),
        committedDate?: string(name='committedDate', example='2022-03-18 09:00:00'),
        committerEmail?: string(name='committerEmail', example='username@example.com'),
        committerName?: string(name='committerName'),
        createdAt?: string(name='createdAt', example='2022-03-18 10:00:00'),
        id?: string(name='id', example='de02b625ba8488f92eb204bcb3773a40c1b4ddac'),
        message?: string(name='message'),
        parentIds?: [ string ](name='parentIds'),
        shortId?: string(name='shortId', example='de02b625'),
        signature?: {
          gpgKeyId?: string(name='gpgKeyId', example='""'),
          verificationStatus?: string(name='verificationStatus', example='verified'),
        }(name='signature'),
        title?: string(name='title'),
      }(name='commit'),
      id?: string(name='id', example='9a494e7b88ca35cde00579af2df4ab46136c022e'),
      message?: string(name='message'),
      name?: string(name='name', example='tag v1.0'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='30'),
}

model ListRepositoryTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRepositoryTagsResponseBody(name='body'),
}

/**
 * @summary 查询标签列表
 *
 * @param request ListRepositoryTagsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRepositoryTagsResponse
 */
async function listRepositoryTagsWithOptions(repositoryId: string, request: ListRepositoryTagsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListRepositoryTagsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.search)) {
    query['search'] = request.search;
  }
  if (!Util.isUnset(request.sort)) {
    query['sort'] = request.sort;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRepositoryTags',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/tag/list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询标签列表
 *
 * @param request ListRepositoryTagsRequest
 * @return ListRepositoryTagsResponse
 */
async function listRepositoryTags(repositoryId: string, request: ListRepositoryTagsRequest): ListRepositoryTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listRepositoryTagsWithOptions(repositoryId, request, headers, runtime);
}

model ListRepositoryTreeRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='624666bd54d036291ae13a36'),
  path?: string(name='path', example='module'),
  refName?: string(name='refName', example='master / tag1.0 / sjjfssa'),
  type?: string(name='type', example='RECURSIVE'),
}

model ListRepositoryTreeResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='6557983C-FB08-51A9-AC5A-A7A0D0950A07'),
  result?: [ 
    {
      id?: string(name='id', example='76c3f251f414ac31f2e01faf6f2008a9d756a437'),
      isLFS?: boolean(name='isLFS', example='false'),
      mode?: string(name='mode', example='100644'),
      name?: string(name='name', example='test-codeup'),
      path?: string(name='path', example='test-codeup'),
      type?: string(name='type', example='blob'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
}

model ListRepositoryTreeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRepositoryTreeResponseBody(name='body'),
}

/**
 * @summary 查询代码库文件树
 *
 * @param request ListRepositoryTreeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRepositoryTreeResponse
 */
async function listRepositoryTreeWithOptions(repositoryId: string, request: ListRepositoryTreeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListRepositoryTreeResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.path)) {
    query['path'] = request.path;
  }
  if (!Util.isUnset(request.refName)) {
    query['refName'] = request.refName;
  }
  if (!Util.isUnset(request.type)) {
    query['type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRepositoryTree',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/files/tree`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询代码库文件树
 *
 * @param request ListRepositoryTreeRequest
 * @return ListRepositoryTreeResponse
 */
async function listRepositoryTree(repositoryId: string, request: ListRepositoryTreeRequest): ListRepositoryTreeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listRepositoryTreeWithOptions(repositoryId, request, headers, runtime);
}

model ListRepositoryWebhookRequest {
  accessToken?: string(name='accessToken'),
  organizationId?: string(name='organizationId', description='This parameter is required.'),
  page?: long(name='page', example='1'),
  pageSize?: long(name='pageSize', example='10'),
}

model ListRepositoryWebhookResponseBody = {
  errorCode?: string(name='errorCode'),
  errorMessage?: string(name='errorMessage'),
  requestId?: string(name='requestId', example='HC93CE1A-8D7A-13A9-8306-7465DE2E5C0F'),
  result?: [ 
    {
      createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
      description?: string(name='description'),
      enableSslVerification?: boolean(name='enableSslVerification', example='false'),
      id?: long(name='id', example='16776'),
      lastTestResult?: string(name='lastTestResult'),
      mergeRequestsEvents?: boolean(name='mergeRequestsEvents', example='true'),
      noteEvents?: boolean(name='noteEvents', example='false'),
      projectId?: long(name='projectId'),
      pushEvents?: boolean(name='pushEvents', example='false'),
      secretToken?: string(name='secretToken', example='xxxx'),
      tagPushEvents?: boolean(name='tagPushEvents', example='false'),
      url?: string(name='url', example='https://xxxx'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='100'),
}

model ListRepositoryWebhookResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRepositoryWebhookResponseBody(name='body'),
}

/**
 * @summary 查询代码库Webhook列表
 *
 * @param request ListRepositoryWebhookRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRepositoryWebhookResponse
 */
async function listRepositoryWebhookWithOptions(repositoryId: string, request: ListRepositoryWebhookRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListRepositoryWebhookResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRepositoryWebhook',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/webhooks/list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询代码库Webhook列表
 *
 * @param request ListRepositoryWebhookRequest
 * @return ListRepositoryWebhookResponse
 */
async function listRepositoryWebhook(repositoryId: string, request: ListRepositoryWebhookRequest): ListRepositoryWebhookResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listRepositoryWebhookWithOptions(repositoryId, request, headers, runtime);
}

model ListResourceMembersResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  resourceMembers?: [ 
    {
      accountId?: string(name='accountId', example='22212212'),
      roleName?: string(name='roleName', example='admin'),
      username?: string(name='username', example='张三'),
    }
  ](name='resourceMembers'),
  success?: boolean(name='success', example='true'),
}

model ListResourceMembersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListResourceMembersResponseBody(name='body'),
}

/**
 * @summary 获取资源成员列表
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListResourceMembersResponse
 */
async function listResourceMembersWithOptions(organizationId: string, resourceType: string, resourceId: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListResourceMembersResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListResourceMembers',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/${OpenApiUtil.getEncodeParam(resourceType)}/${OpenApiUtil.getEncodeParam(resourceId)}/members`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取资源成员列表
 *
 * @return ListResourceMembersResponse
 */
async function listResourceMembers(organizationId: string, resourceType: string, resourceId: string): ListResourceMembersResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listResourceMembersWithOptions(organizationId, resourceType, resourceId, headers, runtime);
}

model ListSearchCommitRequest {
  keyword?: string(name='keyword', description='This parameter is required.', example='test'),
  order?: string(name='order', example='default'),
  page?: int32(name='page', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  repoPath?: {
    matchType?: string(name='matchType', example='term'),
    operatorType?: string(name='operatorType', example='equal'),
    value?: string(name='value', example='orgId/test-group/spring-boot-demo'),
  }(name='repoPath'),
  scope?: string(name='scope', example='all'),
  sort?: string(name='sort', example='desc'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60d54f3daccf2bbd6659f3ad'),
}

model ListSearchCommitResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: [ 
    {
      docId?: string(name='docId', example='60d54f3daccf2bbd6659f3ad/gitlabhq/master/config/environments/test.rb'),
      highlightTextMap?: {
        commitId?: string(name='commitId', example='df1b701cb0f3f7ca92320d49d31995821f2d045c'),
        commitMessage?: string(name='commitMessage'),
        organizationId?: string(name='organizationId', example='60de7a6852743a5162b5f957'),
        title?: string(name='title'),
      }(name='highlightTextMap'),
      source?: {
        author?: {
          email?: string(name='email', example='username@example.com'),
          name?: string(name='name'),
        }(name='author'),
        authorTime?: string(name='authorTime', example='2022-11-11 11:11:11'),
        commitId?: string(name='commitId', example='a748f5ecb17a93900d4808944bfcc96dc158ee2d'),
        commitMessage?: string(name='commitMessage'),
        organizationId?: string(name='organizationId', example='61133b011bd96aa110f1b500'),
        repoPath?: string(name='repoPath', example='codeup/test-repo'),
        title?: string(name='title'),
      }(name='source'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='10'),
}

model ListSearchCommitResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSearchCommitResponseBody(name='body'),
}

/**
 * @summary 搜索代码提交数据
 *
 * @param request ListSearchCommitRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSearchCommitResponse
 */
async function listSearchCommitWithOptions(request: ListSearchCommitRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSearchCommitResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.keyword)) {
    body['keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.order)) {
    body['order'] = request.order;
  }
  if (!Util.isUnset(request.page)) {
    body['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.repoPath)) {
    body['repoPath'] = request.repoPath;
  }
  if (!Util.isUnset(request.scope)) {
    body['scope'] = request.scope;
  }
  if (!Util.isUnset(request.sort)) {
    body['sort'] = request.sort;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSearchCommit',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/search/commit`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 搜索代码提交数据
 *
 * @param request ListSearchCommitRequest
 * @return ListSearchCommitResponse
 */
async function listSearchCommit(request: ListSearchCommitRequest): ListSearchCommitResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSearchCommitWithOptions(request, headers, runtime);
}

model ListSearchRepositoryRequest {
  aliyunPk?: string(name='aliyunPk', example='1840004904455497'),
  keyword?: string(name='keyword', description='This parameter is required.', example='test'),
  order?: string(name='order', example='default'),
  page?: int32(name='page', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  repoPath?: {
    matchType?: string(name='matchType', example='term'),
    operatorType?: string(name='operatorType', example='equal'),
    value?: string(name='value', example='orgId/test-group/spring-boot-demo'),
  }(name='repoPath'),
  scope?: string(name='scope', example='all'),
  sort?: string(name='sort', example='desc'),
  visibilityLevel?: int32(name='visibilityLevel', example='0'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='61e54b0e0bb300d827e1ae27'),
}

model ListSearchRepositoryResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: [ 
    {
      docId?: string(name='docId', example='60d54f3daccf2bbd6659f3ad/gitlabhq/master/config/environments/test.rb'),
      highlightTextMap?: {
        creatorUserId?: string(name='creatorUserId', example='xxx'),
        description?: string(name='description'),
        organizationId?: string(name='organizationId', example='60de7a6852743a5162b5f957'),
        readMe?: string(name='readMe', example='xx'),
        repoNameWithNamespace?: string(name='repoNameWithNamespace', example='codeup/test-repo'),
        repoPath?: string(name='repoPath', example='codeup/test-repo'),
      }(name='highlightTextMap'),
      source?: {
        createTime?: string(name='createTime', example='2022-10-10 10:10:10'),
        description?: string(name='description'),
        lastActivityTime?: string(name='lastActivityTime', example='2022-11-11 11:11:11'),
        organizationId?: string(name='organizationId', example='62a94a8611fc0f0c9e2a7bc1'),
        readMe?: string(name='readMe', example='xxx'),
        repoName?: string(name='repoName', example='test-repo'),
        repoPath?: string(name='repoPath', example='codeup/test-repo'),
        visibilityLevel?: int32(name='visibilityLevel', example='0'),
      }(name='source'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='30'),
}

model ListSearchRepositoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSearchRepositoryResponseBody(name='body'),
}

/**
 * @summary 搜索代码仓库数据
 *
 * @param request ListSearchRepositoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSearchRepositoryResponse
 */
async function listSearchRepositoryWithOptions(request: ListSearchRepositoryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSearchRepositoryResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.aliyunPk)) {
    body['aliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.keyword)) {
    body['keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.order)) {
    body['order'] = request.order;
  }
  if (!Util.isUnset(request.page)) {
    body['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.repoPath)) {
    body['repoPath'] = request.repoPath;
  }
  if (!Util.isUnset(request.scope)) {
    body['scope'] = request.scope;
  }
  if (!Util.isUnset(request.sort)) {
    body['sort'] = request.sort;
  }
  if (!Util.isUnset(request.visibilityLevel)) {
    body['visibilityLevel'] = request.visibilityLevel;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSearchRepository',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/search/repo`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 搜索代码仓库数据
 *
 * @param request ListSearchRepositoryRequest
 * @return ListSearchRepositoryResponse
 */
async function listSearchRepository(request: ListSearchRepositoryRequest): ListSearchRepositoryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSearchRepositoryWithOptions(request, headers, runtime);
}

model ListSearchSourceCodeRequest {
  filePath?: {
    matchType?: string(name='matchType', example='term'),
    operatorType?: string(name='operatorType', example='equal'),
    value?: string(name='value', example='orgId/test-group/spring-boot-demo/test.java'),
  }(name='filePath'),
  isCodeBlock?: boolean(name='isCodeBlock', example='false'),
  keyword?: string(name='keyword', description='This parameter is required.', example='test'),
  language?: string(name='language', example='Java'),
  order?: string(name='order', example='default'),
  page?: int32(name='page', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  repoPath?: {
    matchType?: string(name='matchType', example='term'),
    operatorType?: string(name='operatorType', example='equal'),
    value?: string(name='value', example='xxx'),
  }(name='repoPath'),
  scope?: string(name='scope', example='all'),
  sort?: string(name='sort', example='desc'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='66c0c9fffeb86b450c199fcd'),
}

model ListSearchSourceCodeResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: [ 
    {
      docId?: string(name='docId', example='60d54f3daccf2bbd6659f3ad/gitlabhq/master/spec/frontend/snippets/test_utils.js'),
      highlightTextMap?: {
        clob?: string(name='clob', example='xxx'),
        fileName?: string(name='fileName', example='test.java'),
        language?: string(name='language', example='java'),
        organizationId?: string(name='organizationId', example='60de7a6852743a5162b5f957'),
      }(name='highlightTextMap'),
      source?: {
        branch?: string(name='branch', example='master'),
        checkinDate?: string(name='checkinDate', example='2022-10-10 10:00:00'),
        fileName?: string(name='fileName', example='test_utils.js'),
        filePath?: string(name='filePath', example='spec/frontend/snippets/test_utils.js'),
        language?: string(name='language', example='JavaScript'),
        organizationId?: string(name='organizationId', example='60de7a6852743a5162b5f957'),
        repoPath?: string(name='repoPath', example='codeup/test-repo'),
      }(name='source'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='2'),
}

model ListSearchSourceCodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSearchSourceCodeResponseBody(name='body'),
}

/**
 * @summary 搜索代码片段
 *
 * @param request ListSearchSourceCodeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSearchSourceCodeResponse
 */
async function listSearchSourceCodeWithOptions(request: ListSearchSourceCodeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSearchSourceCodeResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.filePath)) {
    body['filePath'] = request.filePath;
  }
  if (!Util.isUnset(request.isCodeBlock)) {
    body['isCodeBlock'] = request.isCodeBlock;
  }
  if (!Util.isUnset(request.keyword)) {
    body['keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.language)) {
    body['language'] = request.language;
  }
  if (!Util.isUnset(request.order)) {
    body['order'] = request.order;
  }
  if (!Util.isUnset(request.page)) {
    body['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.repoPath)) {
    body['repoPath'] = request.repoPath;
  }
  if (!Util.isUnset(request.scope)) {
    body['scope'] = request.scope;
  }
  if (!Util.isUnset(request.sort)) {
    body['sort'] = request.sort;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSearchSourceCode',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/search/code`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 搜索代码片段
 *
 * @param request ListSearchSourceCodeRequest
 * @return ListSearchSourceCodeResponse
 */
async function listSearchSourceCode(request: ListSearchSourceCodeRequest): ListSearchSourceCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSearchSourceCodeWithOptions(request, headers, runtime);
}

model ListServiceAuthsRequest {
  serviceAuthType?: string(name='serviceAuthType', description='This parameter is required.', example='RAM'),
}

model ListServiceAuthsResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  serviceAuths?: [ 
    {
      id?: long(name='id', example='123'),
      ownerName?: string(name='ownerName', example='张三'),
      ownerStaffId?: string(name='ownerStaffId', example='123456789'),
      type?: string(name='type', example='Codeup'),
    }
  ](name='serviceAuths'),
  success?: boolean(name='success', example='true'),
}

model ListServiceAuthsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServiceAuthsResponseBody(name='body'),
}

/**
 * @summary 获取服务授权列表
 *
 * @param request ListServiceAuthsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServiceAuthsResponse
 */
async function listServiceAuthsWithOptions(organizationId: string, request: ListServiceAuthsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListServiceAuthsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.serviceAuthType)) {
    query['serviceAuthType'] = request.serviceAuthType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListServiceAuths',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/serviceAuths`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取服务授权列表
 *
 * @param request ListServiceAuthsRequest
 * @return ListServiceAuthsResponse
 */
async function listServiceAuths(organizationId: string, request: ListServiceAuthsRequest): ListServiceAuthsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listServiceAuthsWithOptions(organizationId, request, headers, runtime);
}

model ListServiceConnectionsRequest {
  sericeConnectionType?: string(name='sericeConnectionType', description='This parameter is required.', example='codeup'),
}

model ListServiceConnectionsResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  serviceConnections?: [ 
    {
      createTime?: long(name='createTime', example='1586863220000'),
      id?: long(name='id', example='123'),
      name?: string(name='name', example='张三的oss服务连接'),
      ownerAccountId?: long(name='ownerAccountId', example='1212123212121212'),
      type?: string(name='type', example='oss'),
      uuid?: string(name='uuid'),
    }
  ](name='serviceConnections'),
  success?: boolean(name='success', example='true'),
}

model ListServiceConnectionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServiceConnectionsResponseBody(name='body'),
}

/**
 * @summary 获取服务连接列表
 *
 * @param request ListServiceConnectionsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServiceConnectionsResponse
 */
async function listServiceConnectionsWithOptions(organizationId: string, request: ListServiceConnectionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListServiceConnectionsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.sericeConnectionType)) {
    query['sericeConnectionType'] = request.sericeConnectionType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListServiceConnections',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/serviceConnections`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取服务连接列表
 *
 * @param request ListServiceConnectionsRequest
 * @return ListServiceConnectionsResponse
 */
async function listServiceConnections(organizationId: string, request: ListServiceConnectionsRequest): ListServiceConnectionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listServiceConnectionsWithOptions(organizationId, request, headers, runtime);
}

model ListServiceCredentialsRequest {
  serviceCredentialType?: string(name='serviceCredentialType', description='This parameter is required.', example='username_password'),
}

model ListServiceCredentialsResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  serviceCredentials?: [ 
    {
      id?: long(name='id', example='123'),
      ownerName?: string(name='ownerName', example='张三'),
      ownerStaffId?: string(name='ownerStaffId', example='123456789'),
      type?: string(name='type', example='Codeup'),
    }
  ](name='serviceCredentials'),
  success?: boolean(name='success', example='true'),
}

model ListServiceCredentialsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServiceCredentialsResponseBody(name='body'),
}

/**
 * @summary 获取服务证书列表
 *
 * @param request ListServiceCredentialsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServiceCredentialsResponse
 */
async function listServiceCredentialsWithOptions(organizationId: string, request: ListServiceCredentialsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListServiceCredentialsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.serviceCredentialType)) {
    query['serviceCredentialType'] = request.serviceCredentialType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListServiceCredentials',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/serviceCredentials`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取服务证书列表
 *
 * @param request ListServiceCredentialsRequest
 * @return ListServiceCredentialsResponse
 */
async function listServiceCredentials(organizationId: string, request: ListServiceCredentialsRequest): ListServiceCredentialsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listServiceCredentialsWithOptions(organizationId, request, headers, runtime);
}

model ListSprintsRequest {
  maxResults?: long(name='maxResults', example='20'),
  nextToken?: string(name='nextToken', example='""'),
  spaceIdentifier?: string(name='spaceIdentifier', description='This parameter is required.', example='e8bxxxxxxxxxxxxxxxx23'),
  spaceType?: string(name='spaceType', description='This parameter is required.', example='Project'),
}

model ListSprintsResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  maxResults?: long(name='maxResults', example='20'),
  nextToken?: string(name='nextToken', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  sprints?: [ 
    {
      creator?: string(name='creator', example='19xx7043xxxxxxx914'),
      description?: string(name='description', example='xxx'),
      endDate?: long(name='endDate', example='1623916393000'),
      gmtCreate?: long(name='gmtCreate', example='1623916393000'),
      gmtModified?: long(name='gmtModified', example='1623916393000'),
      identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
      modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
      name?: string(name='name', example='demo示例项目'),
      scope?: string(name='scope', example='public'),
      spaceIdentifier?: string(name='spaceIdentifier', example='5e70xxxxxxcd000xxxxe96'),
      startDate?: long(name='startDate', example='1638403200000'),
      status?: string(name='status', example='TODO'),
    }
  ](name='sprints'),
  success?: boolean(name='success', example='true'),
  totalCount?: long(name='totalCount', example='10'),
}

model ListSprintsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSprintsResponseBody(name='body'),
}

/**
 * @summary 获取迭代列表
 *
 * @param request ListSprintsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSprintsResponse
 */
async function listSprintsWithOptions(organizationId: string, request: ListSprintsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSprintsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.maxResults)) {
    query['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.spaceIdentifier)) {
    query['spaceIdentifier'] = request.spaceIdentifier;
  }
  if (!Util.isUnset(request.spaceType)) {
    query['spaceType'] = request.spaceType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSprints',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/sprints/list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取迭代列表
 *
 * @param request ListSprintsRequest
 * @return ListSprintsResponse
 */
async function listSprints(organizationId: string, request: ListSprintsRequest): ListSprintsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSprintsWithOptions(organizationId, request, headers, runtime);
}

model ListTestCaseFieldsRequest {
  spaceIdentifier?: string(name='spaceIdentifier', description='This parameter is required.', example='e8bxxxxxxxxxxxxxxxx23'),
}

model ListTestCaseFieldsResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  fields?: [ 
    {
      className?: string(name='className', example='例：date'),
      creator?: string(name='creator', example='19xx7043xxxxxxx914'),
      defaultValue?: string(name='defaultValue', example='123'),
      description?: string(name='description', example='字段的具体信息'),
      format?: string(name='format', example='list'),
      gmtCreate?: long(name='gmtCreate', example='1623916393000'),
      gmtModified?: long(name='gmtModified', example='1623916393000'),
      identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
      isRequired?: boolean(name='isRequired', example='false'),
      isShowWhenCreate?: boolean(name='isShowWhenCreate', example='false'),
      isSystemRequired?: boolean(name='isSystemRequired', example='false'),
      linkWithService?: string(name='linkWithService', example='null'),
      modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
      name?: string(name='name', example='负责人'),
      options?: [ 
        {
          displayValue?: string(name='displayValue', example='重复的缺陷'),
          fieldIdentifier?: string(name='fieldIdentifier', example='e8bxxxxxxxxxxxxxxxx23'),
          identifier?: string(name='identifier', example='重复的缺陷'),
          level?: long(name='level', example='1'),
          position?: long(name='position', example='null'),
          value?: string(name='value', example='重复的缺陷'),
          valueEn?: string(name='valueEn', example='null'),
        }
      ](name='options'),
      resourceType?: string(name='resourceType', example='例：Workitem'),
      type?: string(name='type', example='NativeField'),
    }
  ](name='fields'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model ListTestCaseFieldsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTestCaseFieldsResponseBody(name='body'),
}

/**
 * @summary 获取测试用例全部字段
 *
 * @param request ListTestCaseFieldsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTestCaseFieldsResponse
 */
async function listTestCaseFieldsWithOptions(organizationId: string, request: ListTestCaseFieldsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTestCaseFieldsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.spaceIdentifier)) {
    query['spaceIdentifier'] = request.spaceIdentifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTestCaseFields',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/testhub/testcase/fields`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取测试用例全部字段
 *
 * @param request ListTestCaseFieldsRequest
 * @return ListTestCaseFieldsResponse
 */
async function listTestCaseFields(organizationId: string, request: ListTestCaseFieldsRequest): ListTestCaseFieldsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTestCaseFieldsWithOptions(organizationId, request, headers, runtime);
}

model ListUserDrawRecordByPkRequest {
  aliyunPk?: string(name='aliyunPk', example='1789095186553536'),
  drawGroup?: string(name='drawGroup', example='task_group_0000'),
  drawPoolName?: string(name='drawPoolName', example='developer-award-draw-pool_123'),
}

model ListUserDrawRecordByPkResponseBody = {
  code?: string(name='code', example='200'),
  data?: [ 
    {
      aliyunPk?: string(name='aliyunPk', example='1401072305438324'),
      drawGroup?: string(name='drawGroup', example='dsadsadsadas'),
      drawPoolName?: string(name='drawPoolName', example='dasdsadasdas'),
      drawResult?: string(name='drawResult', example='2'),
      gmtCreate?: string(name='gmtCreate', example='1545726028000'),
      taskGroupId?: string(name='taskGroupId', example='null'),
      uccId?: string(name='uccId', example='dsadsadasd'),
    }
  ](name='data'),
  message?: string(name='message', example='None'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model ListUserDrawRecordByPkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserDrawRecordByPkResponseBody(name='body'),
}

/**
 * @summary 测试DrawService
 *
 * @param request ListUserDrawRecordByPkRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserDrawRecordByPkResponse
 */
async function listUserDrawRecordByPkWithOptions(request: ListUserDrawRecordByPkRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListUserDrawRecordByPkResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.aliyunPk)) {
    query['aliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.drawGroup)) {
    query['drawGroup'] = request.drawGroup;
  }
  if (!Util.isUnset(request.drawPoolName)) {
    query['drawPoolName'] = request.drawPoolName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUserDrawRecordByPk',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/listUserDrawRecords`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 测试DrawService
 *
 * @param request ListUserDrawRecordByPkRequest
 * @return ListUserDrawRecordByPkResponse
 */
async function listUserDrawRecordByPk(request: ListUserDrawRecordByPkRequest): ListUserDrawRecordByPkResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listUserDrawRecordByPkWithOptions(request, headers, runtime);
}

model ListUserKeysRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  orderBy?: string(name='orderBy', example='created_at'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  page?: long(name='page', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  sort?: string(name='sort', example='desc'),
}

model ListUserKeysResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='Openapi.RequestError'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: [ 
    {
      createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
      expireTime?: string(name='expireTime', example='2022-03-18 14:24:54'),
      fingerPrint?: string(name='fingerPrint', example='xxx'),
      id?: long(name='id', example='5240'),
      keyScope?: string(name='keyScope', example='ALL'),
      lastUsedTime?: string(name='lastUsedTime', example='2022-03-18 14:24:54'),
      publicKey?: string(name='publicKey', example='xxx'),
      title?: string(name='title'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
}

model ListUserKeysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserKeysResponseBody(name='body'),
}

/**
 * @summary 查询当前用户的SSH Key列表
 *
 * @param request ListUserKeysRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserKeysResponse
 */
async function listUserKeysWithOptions(request: ListUserKeysRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListUserKeysResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.orderBy)) {
    query['orderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sort)) {
    query['sort'] = request.sort;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUserKeys',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v3/user/keys`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询当前用户的SSH Key列表
 *
 * @param request ListUserKeysRequest
 * @return ListUserKeysResponse
 */
async function listUserKeys(request: ListUserKeysRequest): ListUserKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listUserKeysWithOptions(request, headers, runtime);
}

model ListUserResourcesRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  page?: long(name='page', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  userIds?: string(name='userIds', example='1,2,3'),
}

model ListUserResourcesResponseBody = {
  errorCode?: string(name='errorCode', example='success'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='A35869D5-BB29-5F84-A4DD-B09985EA2AFA'),
  result?: [ 
    {
      groupInfos?: [ 
        {
          groupInfo?: {
            createdAt?: string(name='createdAt', example='2022-01-14T21:08:26+08:00'),
            description?: string(name='description', example='test-group'),
            id?: long(name='id', example='35268'),
            name?: string(name='name', example='test-group'),
            nameWithNamespace?: string(name='nameWithNamespace'),
            ownerId?: long(name='ownerId', example='1234'),
            parentId?: long(name='parentId', example='1183319'),
            path?: string(name='path', example='test-group'),
            pathWithNamespace?: string(name='pathWithNamespace', example='test-org/test-group'),
            updatedAt?: string(name='updatedAt', example='2022-01-14T21:08:26+08:00'),
            visibilityLevel?: int32(name='visibilityLevel', example='0'),
          }(name='groupInfo'),
          groupRole?: {
            accessLevel?: int32(name='accessLevel', example='40'),
            cnRoleName?: string(name='cnRoleName'),
            enRoleName?: string(name='enRoleName', example='Admin'),
            sourceId?: long(name='sourceId', example='35268'),
            sourceType?: string(name='sourceType', example='Namespace'),
          }(name='groupRole'),
        }
      ](name='groupInfos'),
      repositoryInfos?: [ 
        {
          repositoryInfo?: {
            accessLevel?: int32(name='accessLevel', example='40'),
            archived?: boolean(name='archived', example='false'),
            createdAt?: string(name='createdAt', example='2022-01-14T21:08:26+08:00'),
            creatorId?: long(name='creatorId', example='12679'),
            description?: string(name='description'),
            encrypted?: boolean(name='encrypted', example='false'),
            id?: long(name='id', example='37229'),
            lastActivityAt?: string(name='lastActivityAt', example='2022-01-14T21:08:26+08:00'),
            name?: string(name='name', example='test-repo'),
            nameWithNamespace?: string(name='nameWithNamespace'),
            namespaceId?: long(name='namespaceId', example='600002'),
            path?: string(name='path', example='test-repo'),
            pathWithNamespace?: string(name='pathWithNamespace', example='test-org/test-group/test-repo'),
            updatedAt?: string(name='updatedAt', example='2022-01-14T21:08:26+08:00'),
            visibilityLevel?: int32(name='visibilityLevel', example='0'),
          }(name='repositoryInfo'),
          repositoryRole?: {
            accessLevel?: int32(name='accessLevel', example='40'),
            cnRoleName?: string(name='cnRoleName'),
            enRoleName?: string(name='enRoleName', example='Admin'),
            sourceId?: long(name='sourceId', example='37229'),
            sourceType?: string(name='sourceType', example='Project'),
          }(name='repositoryRole'),
        }
      ](name='repositoryInfos'),
      userInfo?: {
        avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
        email?: string(name='email', example='username@example.com'),
        id?: long(name='id', example='19230'),
        name?: string(name='name', example='test-codeup'),
        state?: string(name='state', example='active'),
        username?: string(name='username', example='test-codeup'),
      }(name='userInfo'),
    }
  ](name='result'),
  success?: boolean(name='success', example='true'),
  total?: long(name='total', example='2'),
}

model ListUserResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserResourcesResponseBody(name='body'),
}

/**
 * @summary 查询用户有权限的资源（代码库、组）
 *
 * @param request ListUserResourcesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserResourcesResponse
 */
async function listUserResourcesWithOptions(request: ListUserResourcesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListUserResourcesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.userIds)) {
    query['userIds'] = request.userIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUserResources',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/user/vision/user_resources`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询用户有权限的资源（代码库、组）
 *
 * @param request ListUserResourcesRequest
 * @return ListUserResourcesResponse
 */
async function listUserResources(request: ListUserResourcesRequest): ListUserResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listUserResourcesWithOptions(request, headers, runtime);
}

model ListVariableGroupsRequest {
  maxResults?: int32(name='maxResults', example='20'),
  nextToken?: string(name='nextToken', example='aaaaaa'),
  pageOrder?: string(name='pageOrder', example='DESC'),
  pageSort?: string(name='pageSort', example='ID'),
}

model ListVariableGroupsResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  nextToken?: string(name='nextToken', example='assassa'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  totalCount?: long(name='totalCount', example='30'),
  variableGroups?: [ 
    {
      createTime?: long(name='createTime', example='1586863220000'),
      creatorAccountId?: string(name='creatorAccountId', example='13232343434343'),
      description?: string(name='description', example='变量组'),
      id?: long(name='id', example='12234'),
      modifierAccountId?: string(name='modifierAccountId', example='13232343434343'),
      name?: string(name='name', example='变量组'),
      relatedPipelines?: [ 
        {
          id?: long(name='id', example='1234'),
          name?: string(name='name', example='流水线'),
        }
      ](name='relatedPipelines'),
      updateTime?: long(name='updateTime', example='1586863220000'),
      variables?: [ 
        {
          isEncrypted?: boolean(name='isEncrypted', example='true'),
          name?: string(name='name', example='name1'),
          value?: string(name='value', example='value1'),
        }
      ](name='variables'),
    }
  ](name='variableGroups'),
}

model ListVariableGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListVariableGroupsResponseBody(name='body'),
}

/**
 * @summary 获取变量组列表
 *
 * @param request ListVariableGroupsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListVariableGroupsResponse
 */
async function listVariableGroupsWithOptions(organizationId: string, request: ListVariableGroupsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListVariableGroupsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.maxResults)) {
    query['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.pageOrder)) {
    query['pageOrder'] = request.pageOrder;
  }
  if (!Util.isUnset(request.pageSort)) {
    query['pageSort'] = request.pageSort;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListVariableGroups',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/variableGroups`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取变量组列表
 *
 * @param request ListVariableGroupsRequest
 * @return ListVariableGroupsResponse
 */
async function listVariableGroups(organizationId: string, request: ListVariableGroupsRequest): ListVariableGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listVariableGroupsWithOptions(organizationId, request, headers, runtime);
}

model ListWorkItemAllFieldsRequest {
  spaceIdentifier?: string(name='spaceIdentifier', description='This parameter is required.', example='e8bxxxxxxxxxxxxxxxx23'),
  spaceType?: string(name='spaceType', description='This parameter is required.', example='Project'),
  workitemTypeIdentifier?: string(name='workitemTypeIdentifier', description='This parameter is required.', example='dfexxxxxf4fee18xxxxx36'),
}

model ListWorkItemAllFieldsResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  fields?: [ 
    {
      className?: string(name='className', example='例：date'),
      creator?: string(name='creator', example='19xx7043xxxxxxx914'),
      defaultValue?: string(name='defaultValue', example='123'),
      description?: string(name='description', example='字段的具体信息'),
      format?: string(name='format', example='list'),
      gmtCreate?: long(name='gmtCreate', example='1623916393000'),
      gmtModified?: long(name='gmtModified', example='1623916393000'),
      identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
      isRequired?: boolean(name='isRequired', example='false'),
      isShowWhenCreate?: boolean(name='isShowWhenCreate', example='false'),
      isSystemRequired?: boolean(name='isSystemRequired', example='false'),
      linkWithService?: string(name='linkWithService', example='null'),
      modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
      name?: string(name='name', example='负责人'),
      options?: [ 
        {
          displayValue?: string(name='displayValue', example='重复的缺陷'),
          fieldIdentifier?: string(name='fieldIdentifier', example='e8bxxxxxxxxxxxxxxxx23'),
          identifier?: string(name='identifier', example='重复的缺陷'),
          level?: long(name='level', example='1'),
          position?: long(name='position', example='1'),
          value?: string(name='value', example='重复的缺陷'),
          valueEn?: string(name='valueEn', example='null'),
        }
      ](name='options'),
      resourceType?: string(name='resourceType', example='例：Workitem'),
      type?: string(name='type', example='NativeField'),
    }
  ](name='fields'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model ListWorkItemAllFieldsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWorkItemAllFieldsResponseBody(name='body'),
}

/**
 * @summary 获取项目下工作项的所有字段
 *
 * @param request ListWorkItemAllFieldsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWorkItemAllFieldsResponse
 */
async function listWorkItemAllFieldsWithOptions(organizationId: string, request: ListWorkItemAllFieldsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListWorkItemAllFieldsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.spaceIdentifier)) {
    query['spaceIdentifier'] = request.spaceIdentifier;
  }
  if (!Util.isUnset(request.spaceType)) {
    query['spaceType'] = request.spaceType;
  }
  if (!Util.isUnset(request.workitemTypeIdentifier)) {
    query['workitemTypeIdentifier'] = request.workitemTypeIdentifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListWorkItemAllFields',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/fields/listAll`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取项目下工作项的所有字段
 *
 * @param request ListWorkItemAllFieldsRequest
 * @return ListWorkItemAllFieldsResponse
 */
async function listWorkItemAllFields(organizationId: string, request: ListWorkItemAllFieldsRequest): ListWorkItemAllFieldsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listWorkItemAllFieldsWithOptions(organizationId, request, headers, runtime);
}

model ListWorkItemWorkFlowStatusRequest {
  spaceIdentifier?: string(name='spaceIdentifier', description='This parameter is required.', example='例：5e70xxxxxxcd000xxxxe96'),
  spaceType?: string(name='spaceType', description='This parameter is required.', example='Project'),
  workitemCategoryIdentifier?: string(name='workitemCategoryIdentifier', description='This parameter is required.', example='Req'),
  workitemTypeIdentifier?: string(name='workitemTypeIdentifier', example='例：5e7xxxxb3cd3711dd6xxx2c'),
}

model ListWorkItemWorkFlowStatusResponseBody = {
  errorCode?: string(name='errorCode', example='例：Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='errormessage'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  statuses?: [ 
    {
      creator?: string(name='creator', example='用户阿里云pk，例如19xxxx31947xxxx'),
      description?: string(name='description', example='该状态的具体信息'),
      gmtCreate?: long(name='gmtCreate', example='1620455467000'),
      gmtModified?: long(name='gmtModified', example='1641870287000'),
      identifier?: string(name='identifier', example='dfexxxxxf4fee18xxxxx36'),
      modifier?: string(name='modifier', example='用户阿里云pk，例如19xxxx31947xxxx'),
      name?: string(name='name', example='例：待处理'),
      resourceType?: string(name='resourceType', example='Workitem'),
      source?: string(name='source', example='system'),
      workflowStageIdentifier?: string(name='workflowStageIdentifier', example='例如：1'),
      workflowStageName?: string(name='workflowStageName', example='例：确认阶段'),
    }
  ](name='statuses'),
  success?: boolean(name='success', example='true或者false'),
}

model ListWorkItemWorkFlowStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWorkItemWorkFlowStatusResponseBody(name='body'),
}

/**
 * @summary 查询工作项工作流的所有状态
 *
 * @param request ListWorkItemWorkFlowStatusRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWorkItemWorkFlowStatusResponse
 */
async function listWorkItemWorkFlowStatusWithOptions(organizationId: string, request: ListWorkItemWorkFlowStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListWorkItemWorkFlowStatusResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.spaceIdentifier)) {
    query['spaceIdentifier'] = request.spaceIdentifier;
  }
  if (!Util.isUnset(request.spaceType)) {
    query['spaceType'] = request.spaceType;
  }
  if (!Util.isUnset(request.workitemCategoryIdentifier)) {
    query['workitemCategoryIdentifier'] = request.workitemCategoryIdentifier;
  }
  if (!Util.isUnset(request.workitemTypeIdentifier)) {
    query['workitemTypeIdentifier'] = request.workitemTypeIdentifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListWorkItemWorkFlowStatus',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/workflow/listWorkflowStatus`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询工作项工作流的所有状态
 *
 * @param request ListWorkItemWorkFlowStatusRequest
 * @return ListWorkItemWorkFlowStatusResponse
 */
async function listWorkItemWorkFlowStatus(organizationId: string, request: ListWorkItemWorkFlowStatusRequest): ListWorkItemWorkFlowStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listWorkItemWorkFlowStatusWithOptions(organizationId, request, headers, runtime);
}

model ListWorkitemAttachmentsResponseBody = {
  attachments?: [ 
    {
      creator?: string(name='creator', example='237109'),
      fileIdentifier?: string(name='fileIdentifier', example='dflkjlsdddsdl234lkjfg'),
      fileName?: string(name='fileName', example='Artifacts_1565193_1.tgz'),
      fileSuffix?: string(name='fileSuffix', example='tgz'),
      gmtCreate?: long(name='gmtCreate', example='1545726028000'),
      size?: string(name='size', example='50'),
      url?: string(name='url', example='http://grace-share.oss-cn-hangzhou.aliyuncs.com/qf%2Fheap.bin?Expires=1675750082&OSSAccessKeyId=LTAI5t8irN2Wu3BGrBpffZue&Signature=RqRUEuHiwW8wuahYz6CenHaWWs4%3D'),
    }
  ](name='attachments'),
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', description='Id of the request', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  success?: boolean(name='success', example='true'),
}

model ListWorkitemAttachmentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWorkitemAttachmentsResponseBody(name='body'),
}

/**
 * @summary 获取工作项的附件列表
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWorkitemAttachmentsResponse
 */
async function listWorkitemAttachmentsWithOptions(organizationId: string, workitemIdentifier: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListWorkitemAttachmentsResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListWorkitemAttachments',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitem/${OpenApiUtil.getEncodeParam(workitemIdentifier)}/attachments`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取工作项的附件列表
 *
 * @return ListWorkitemAttachmentsResponse
 */
async function listWorkitemAttachments(organizationId: string, workitemIdentifier: string): ListWorkitemAttachmentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listWorkitemAttachmentsWithOptions(organizationId, workitemIdentifier, headers, runtime);
}

model ListWorkitemEstimateResponseBody = {
  code?: long(name='code', example='200'),
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  workitemTimeEstimate?: [ 
    {
      description?: string(name='description', example='开发代码等'),
      gmtCreate?: long(name='gmtCreate', example='1653235200000'),
      gmtEnd?: long(name='gmtEnd', example='1653235200000'),
      gmtModified?: long(name='gmtModified', example='1653235200000'),
      gmtStart?: long(name='gmtStart', example='1653235200000'),
      identifier?: string(name='identifier', example='a4ac3a81e90217db32b7......'),
      recordUser?: {
        identifier?: string(name='identifier', example='132xxxx123'),
        name?: string(name='name'),
      }(name='recordUser'),
      spentTime?: float(name='spentTime', example='8'),
      type?: string(name='type', example='研发'),
      workitemIdentifier?: string(name='workitemIdentifier', example='5daa9a15c7fd55523996......'),
    }
  ](name='workitemTimeEstimate'),
}

model ListWorkitemEstimateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWorkitemEstimateResponseBody(name='body'),
}

/**
 * @summary 获取工作项预计工时明细列表
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWorkitemEstimateResponse
 */
async function listWorkitemEstimateWithOptions(organizationId: string, workitemId: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListWorkitemEstimateResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListWorkitemEstimate',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/${OpenApiUtil.getEncodeParam(workitemId)}/estimate/list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取工作项预计工时明细列表
 *
 * @return ListWorkitemEstimateResponse
 */
async function listWorkitemEstimate(organizationId: string, workitemId: string): ListWorkitemEstimateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listWorkitemEstimateWithOptions(organizationId, workitemId, headers, runtime);
}

model ListWorkitemTimeResponseBody = {
  code?: long(name='code', example='200'),
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  workitemTime?: [ 
    {
      actualTime?: float(name='actualTime', example='1'),
      description?: string(name='description', example='开发代码等'),
      gmtCreate?: long(name='gmtCreate', example='1653235200000'),
      gmtEnd?: long(name='gmtEnd', example='1653235200000'),
      gmtModified?: long(name='gmtModified', example='1653235200000'),
      gmtStart?: long(name='gmtStart', example='1653235200000'),
      identifier?: string(name='identifier', example='a4ac3a81e90217db32b7......'),
      recordUser?: string(name='recordUser', example='1967043931......'),
      type?: string(name='type', example='研发'),
      workitemIdentifier?: string(name='workitemIdentifier', example='5daa9a15c7fd55523996......'),
    }
  ](name='workitemTime'),
}

model ListWorkitemTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWorkitemTimeResponseBody(name='body'),
}

/**
 * @summary 获取工作项工时明细列表
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWorkitemTimeResponse
 */
async function listWorkitemTimeWithOptions(organizationId: string, workitemId: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListWorkitemTimeResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListWorkitemTime',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/${OpenApiUtil.getEncodeParam(workitemId)}/time/list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取工作项工时明细列表
 *
 * @return ListWorkitemTimeResponse
 */
async function listWorkitemTime(organizationId: string, workitemId: string): ListWorkitemTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listWorkitemTimeWithOptions(organizationId, workitemId, headers, runtime);
}

model ListWorkitemsRequest {
  category?: string(name='category', description='This parameter is required.', example='Req'),
  conditions?: string(name='conditions', example='{"conditionGroups":[]}'),
  extraConditions?: string(name='extraConditions', example='{"conditionGroups":[]}'),
  groupCondition?: string(name='groupCondition', example='{"fieldIdentifier":"tag","className":"tag","format":"multiList","value":["c76e0e4bf64801cfad73......"],"operator":"EQUALS"}'),
  maxResults?: string(name='maxResults', example='20'),
  nextToken?: string(name='nextToken', example='""'),
  orderBy?: string(name='orderBy', example='{"fieldIdentifier":"status","format":"list","order":"desc","className":"status"}'),
  searchType?: string(name='searchType', example='LIST'),
  spaceIdentifier?: string(name='spaceIdentifier', description='This parameter is required.', example='8fb83debd69a6c7c6626......'),
  spaceType?: string(name='spaceType', description='This parameter is required.', example='Project'),
}

model ListWorkitemsResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  maxResults?: long(name='maxResults', example='20'),
  nextToken?: string(name='nextToken', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  totalCount?: long(name='totalCount', example='10'),
  workitems?: [ 
    {
      assignedTo?: string(name='assignedTo', example='19xx7043xxxxxxx914'),
      categoryIdentifier?: string(name='categoryIdentifier', example='Req'),
      creator?: string(name='creator', example='19xx7043xxxxxxx914'),
      document?: string(name='document', example='html格式'),
      finishTime?: long(name='finishTime'),
      gmtCreate?: long(name='gmtCreate', example='1640850318000'),
      gmtModified?: long(name='gmtModified', example='1640850318000'),
      identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
      logicalStatus?: string(name='logicalStatus', example='NORMAL'),
      modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
      parentIdentifier?: string(name='parentIdentifier', example='e8bxxxxxxxxxxxxxxxx24'),
      serialNumber?: string(name='serialNumber', example='ABCD-1'),
      spaceIdentifier?: string(name='spaceIdentifier', example='e8b26xxxxx6e76aa20xxxxx23'),
      spaceName?: string(name='spaceName', example='需求项目'),
      spaceType?: string(name='spaceType', example='Project'),
      sprintIdentifier?: string(name='sprintIdentifier', example='75528f17703e92e5a568......'),
      status?: string(name='status', example='待处理'),
      statusIdentifier?: string(name='statusIdentifier', example='100005'),
      statusStageIdentifier?: string(name='statusStageIdentifier', example='1'),
      subject?: string(name='subject', example='测试工作项'),
      updateStatusAt?: long(name='updateStatusAt', example='1640850328000'),
      workitemTypeIdentifier?: string(name='workitemTypeIdentifier', example='9uxxxxxxre573f5xxxxxx0'),
    }
  ](name='workitems'),
}

model ListWorkitemsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWorkitemsResponseBody(name='body'),
}

/**
 * @summary 获取工作项列表
 *
 * @param request ListWorkitemsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWorkitemsResponse
 */
async function listWorkitemsWithOptions(organizationId: string, request: ListWorkitemsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListWorkitemsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.category)) {
    query['category'] = request.category;
  }
  if (!Util.isUnset(request.conditions)) {
    query['conditions'] = request.conditions;
  }
  if (!Util.isUnset(request.extraConditions)) {
    query['extraConditions'] = request.extraConditions;
  }
  if (!Util.isUnset(request.groupCondition)) {
    query['groupCondition'] = request.groupCondition;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.orderBy)) {
    query['orderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.searchType)) {
    query['searchType'] = request.searchType;
  }
  if (!Util.isUnset(request.spaceIdentifier)) {
    query['spaceIdentifier'] = request.spaceIdentifier;
  }
  if (!Util.isUnset(request.spaceType)) {
    query['spaceType'] = request.spaceType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListWorkitems',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/listWorkitems`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取工作项列表
 *
 * @param request ListWorkitemsRequest
 * @return ListWorkitemsResponse
 */
async function listWorkitems(organizationId: string, request: ListWorkitemsRequest): ListWorkitemsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listWorkitemsWithOptions(organizationId, request, headers, runtime);
}

model LogPipelineJobRunResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  log?: {
    content?: string(name='content', example='success'),
    more?: boolean(name='more', example='true'),
  }(name='log'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model LogPipelineJobRunResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LogPipelineJobRunResponseBody(name='body'),
}

/**
 * @summary 获取流水线运行任务日志
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return LogPipelineJobRunResponse
 */
async function logPipelineJobRunWithOptions(organizationId: string, pipelineId: string, jobId: string, pipelineRunId: string, headers: map[string]string, runtime: Util.RuntimeOptions): LogPipelineJobRunResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'LogPipelineJobRun',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipeline/${OpenApiUtil.getEncodeParam(pipelineId)}/pipelineRun/${OpenApiUtil.getEncodeParam(pipelineRunId)}/job/${OpenApiUtil.getEncodeParam(jobId)}/logs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流水线运行任务日志
 *
 * @return LogPipelineJobRunResponse
 */
async function logPipelineJobRun(organizationId: string, pipelineId: string, jobId: string, pipelineRunId: string): LogPipelineJobRunResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return logPipelineJobRunWithOptions(organizationId, pipelineId, jobId, pipelineRunId, headers, runtime);
}

model LogVMDeployMachineResponseBody = {
  deployMachineLog?: {
    aliyunRegion?: string(name='aliyunRegion', example='cn-hangzhou'),
    deployBeginTime?: long(name='deployBeginTime', example='11111111111'),
    deployEndTime?: long(name='deployEndTime', example='12222222'),
    deployLog?: string(name='deployLog', example='success'),
    deployLogPath?: string(name='deployLogPath', example='/tmp/log'),
  }(name='deployMachineLog'),
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model LogVMDeployMachineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LogVMDeployMachineResponseBody(name='body'),
}

/**
 * @summary 获取机器部署日志
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return LogVMDeployMachineResponse
 */
async function logVMDeployMachineWithOptions(organizationId: string, pipelineId: string, deployOrderId: string, machineSn: string, headers: map[string]string, runtime: Util.RuntimeOptions): LogVMDeployMachineResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'LogVMDeployMachine',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/deploy/${OpenApiUtil.getEncodeParam(deployOrderId)}/machine/${OpenApiUtil.getEncodeParam(machineSn)}/log`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取机器部署日志
 *
 * @return LogVMDeployMachineResponse
 */
async function logVMDeployMachine(organizationId: string, pipelineId: string, deployOrderId: string, machineSn: string): LogVMDeployMachineResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return logVMDeployMachineWithOptions(organizationId, pipelineId, deployOrderId, machineSn, headers, runtime);
}

model MergeMergeRequestRequest {
  accessToken?: string(name='accessToken', example='0cf2c8458ac44d9481aab2dd6ec10596v3'),
  mergeMessage?: string(name='mergeMessage', example='""'),
  mergeType?: string(name='mergeType', description='This parameter is required.', example='no-fast-forward'),
  removeSourceBranch?: boolean(name='removeSourceBranch', example='true'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model MergeMergeRequestResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='9ED5E382-3A58-51E4-8A81-CE25D1756025'),
  result?: {
    bizId?: string(name='bizId'),
    localId?: long(name='localId'),
    mergedRevision?: string(name='mergedRevision'),
    projectId?: long(name='projectId'),
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model MergeMergeRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MergeMergeRequestResponseBody(name='body'),
}

/**
 * @summary 合并代码评审
 *
 * @param request MergeMergeRequestRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return MergeMergeRequestResponse
 */
async function mergeMergeRequestWithOptions(repositoryId: string, localId: string, request: MergeMergeRequestRequest, headers: map[string]string, runtime: Util.RuntimeOptions): MergeMergeRequestResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.mergeMessage)) {
    body['mergeMessage'] = request.mergeMessage;
  }
  if (!Util.isUnset(request.mergeType)) {
    body['mergeType'] = request.mergeType;
  }
  if (!Util.isUnset(request.removeSourceBranch)) {
    body['removeSourceBranch'] = request.removeSourceBranch;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'MergeMergeRequest',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/${OpenApiUtil.getEncodeParam(repositoryId)}/merge_requests/${OpenApiUtil.getEncodeParam(localId)}/merge`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 合并代码评审
 *
 * @param request MergeMergeRequestRequest
 * @return MergeMergeRequestResponse
 */
async function mergeMergeRequest(repositoryId: string, localId: string, request: MergeMergeRequestRequest): MergeMergeRequestResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return mergeMergeRequestWithOptions(repositoryId, localId, request, headers, runtime);
}

model PassPipelineValidateResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model PassPipelineValidateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PassPipelineValidateResponseBody(name='body'),
}

/**
 * @summary 通过人工卡点
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return PassPipelineValidateResponse
 */
async function passPipelineValidateWithOptions(organizationId: string, pipelineId: string, pipelineRunId: string, jobId: string, headers: map[string]string, runtime: Util.RuntimeOptions): PassPipelineValidateResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'PassPipelineValidate',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/pipelineRuns/${OpenApiUtil.getEncodeParam(pipelineRunId)}/jobs/${OpenApiUtil.getEncodeParam(jobId)}/pass`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 通过人工卡点
 *
 * @return PassPipelineValidateResponse
 */
async function passPipelineValidate(organizationId: string, pipelineId: string, pipelineRunId: string, jobId: string): PassPipelineValidateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return passPipelineValidateWithOptions(organizationId, pipelineId, pipelineRunId, jobId, headers, runtime);
}

model PassReleaseStagePipelineValidateRequest {
  jobId?: string(name='jobId', description='This parameter is required.', example='226241***'),
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199***'),
}

model PassReleaseStagePipelineValidateResponseBody = {
  success?: boolean(name='success', example='true'),
}

model PassReleaseStagePipelineValidateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PassReleaseStagePipelineValidateResponseBody(name='body'),
}

/**
 * @summary 通过人工卡点
 *
 * @param request PassReleaseStagePipelineValidateRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return PassReleaseStagePipelineValidateResponse
 */
async function passReleaseStagePipelineValidateWithOptions(appName: string, releaseWorkflowSn: string, releaseStageSn: string, executionNumber: string, request: PassReleaseStagePipelineValidateRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PassReleaseStagePipelineValidateResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.jobId)) {
    query['jobId'] = request.jobId;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PassReleaseStagePipelineValidate',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/releaseWorkflows/${OpenApiUtil.getEncodeParam(releaseWorkflowSn)}/releaseStages/${OpenApiUtil.getEncodeParam(releaseStageSn)}/executions/${OpenApiUtil.getEncodeParam(executionNumber)}%3ApassPipelineValidate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 通过人工卡点
 *
 * @param request PassReleaseStagePipelineValidateRequest
 * @return PassReleaseStagePipelineValidateResponse
 */
async function passReleaseStagePipelineValidate(appName: string, releaseWorkflowSn: string, releaseStageSn: string, executionNumber: string, request: PassReleaseStagePipelineValidateRequest): PassReleaseStagePipelineValidateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return passReleaseStagePipelineValidateWithOptions(appName, releaseWorkflowSn, releaseStageSn, executionNumber, request, headers, runtime);
}

model RefusePipelineValidateResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model RefusePipelineValidateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefusePipelineValidateResponseBody(name='body'),
}

/**
 * @summary 拒绝人工卡点
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefusePipelineValidateResponse
 */
async function refusePipelineValidateWithOptions(organizationId: string, pipelineId: string, pipelineRunId: string, jobId: string, headers: map[string]string, runtime: Util.RuntimeOptions): RefusePipelineValidateResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'RefusePipelineValidate',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/pipelineRuns/${OpenApiUtil.getEncodeParam(pipelineRunId)}/jobs/${OpenApiUtil.getEncodeParam(jobId)}/refuse`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 拒绝人工卡点
 *
 * @return RefusePipelineValidateResponse
 */
async function refusePipelineValidate(organizationId: string, pipelineId: string, pipelineRunId: string, jobId: string): RefusePipelineValidateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return refusePipelineValidateWithOptions(organizationId, pipelineId, pipelineRunId, jobId, headers, runtime);
}

model RefuseReleaseStagePipelineValidateRequest {
  jobId?: string(name='jobId', description='This parameter is required.', example='226241***'),
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c19****'),
}

model RefuseReleaseStagePipelineValidateResponseBody = {
  success?: boolean(name='success', example='true'),
}

model RefuseReleaseStagePipelineValidateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefuseReleaseStagePipelineValidateResponseBody(name='body'),
}

/**
 * @summary 拒绝人工卡点
 *
 * @param request RefuseReleaseStagePipelineValidateRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefuseReleaseStagePipelineValidateResponse
 */
async function refuseReleaseStagePipelineValidateWithOptions(appName: string, releaseWorkflowSn: string, releaseStageSn: string, executionNumber: string, request: RefuseReleaseStagePipelineValidateRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RefuseReleaseStagePipelineValidateResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.jobId)) {
    query['jobId'] = request.jobId;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RefuseReleaseStagePipelineValidate',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/releaseWorkflows/${OpenApiUtil.getEncodeParam(releaseWorkflowSn)}/releaseStages/${OpenApiUtil.getEncodeParam(releaseStageSn)}/executions/${OpenApiUtil.getEncodeParam(executionNumber)}%3ArefusePipelineValidate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 拒绝人工卡点
 *
 * @param request RefuseReleaseStagePipelineValidateRequest
 * @return RefuseReleaseStagePipelineValidateResponse
 */
async function refuseReleaseStagePipelineValidate(appName: string, releaseWorkflowSn: string, releaseStageSn: string, executionNumber: string, request: RefuseReleaseStagePipelineValidateRequest): RefuseReleaseStagePipelineValidateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return refuseReleaseStagePipelineValidateWithOptions(appName, releaseWorkflowSn, releaseStageSn, executionNumber, request, headers, runtime);
}

model ReopenMergeRequestRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
}

model ReopenMergeRequestResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='313A1BF6-63B7-52D4-A098-952221A65254'),
  result?: {
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model ReopenMergeRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReopenMergeRequestResponseBody(name='body'),
}

/**
 * @summary 重新打开代码评审
 *
 * @param request ReopenMergeRequestRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReopenMergeRequestResponse
 */
async function reopenMergeRequestWithOptions(repositoryId: string, localId: string, request: ReopenMergeRequestRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ReopenMergeRequestResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReopenMergeRequest',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/${OpenApiUtil.getEncodeParam(repositoryId)}/merge_requests/${OpenApiUtil.getEncodeParam(localId)}/reopen`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 重新打开代码评审
 *
 * @param request ReopenMergeRequestRequest
 * @return ReopenMergeRequestResponse
 */
async function reopenMergeRequest(repositoryId: string, localId: string, request: ReopenMergeRequestRequest): ReopenMergeRequestResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return reopenMergeRequestWithOptions(repositoryId, localId, request, headers, runtime);
}

model ResetSshKeyResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  sshKey?: {
    id?: long(name='id', example='1212'),
    publicKey?: string(name='publicKey', example='saaaaaaaaaaaaaaaa'),
  }(name='sshKey'),
  success?: boolean(name='success', example='true'),
}

model ResetSshKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetSshKeyResponseBody(name='body'),
}

/**
 * @summary 重置企业公钥
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetSshKeyResponse
 */
async function resetSshKeyWithOptions(organizationId: string, headers: map[string]string, runtime: Util.RuntimeOptions): ResetSshKeyResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ResetSshKey',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/sshKey`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 重置企业公钥
 *
 * @return ResetSshKeyResponse
 */
async function resetSshKey(organizationId: string): ResetSshKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return resetSshKeyWithOptions(organizationId, headers, runtime);
}

model ResumeVMDeployOrderResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model ResumeVMDeployOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResumeVMDeployOrderResponseBody(name='body'),
}

/**
 * @summary 继续部署
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResumeVMDeployOrderResponse
 */
async function resumeVMDeployOrderWithOptions(organizationId: string, pipelineId: string, deployOrderId: string, headers: map[string]string, runtime: Util.RuntimeOptions): ResumeVMDeployOrderResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ResumeVMDeployOrder',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/deploy/${OpenApiUtil.getEncodeParam(deployOrderId)}/resume`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 继续部署
 *
 * @return ResumeVMDeployOrderResponse
 */
async function resumeVMDeployOrder(organizationId: string, pipelineId: string, deployOrderId: string): ResumeVMDeployOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return resumeVMDeployOrderWithOptions(organizationId, pipelineId, deployOrderId, headers, runtime);
}

model RetryPipelineJobRunResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model RetryPipelineJobRunResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RetryPipelineJobRunResponseBody(name='body'),
}

/**
 * @summary 重试流水线运行
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RetryPipelineJobRunResponse
 */
async function retryPipelineJobRunWithOptions(organizationId: string, pipelineId: string, pipelineRunId: string, jobId: string, headers: map[string]string, runtime: Util.RuntimeOptions): RetryPipelineJobRunResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'RetryPipelineJobRun',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/pipelineRuns/${OpenApiUtil.getEncodeParam(pipelineRunId)}/jobs/${OpenApiUtil.getEncodeParam(jobId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 重试流水线运行
 *
 * @return RetryPipelineJobRunResponse
 */
async function retryPipelineJobRun(organizationId: string, pipelineId: string, pipelineRunId: string, jobId: string): RetryPipelineJobRunResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return retryPipelineJobRunWithOptions(organizationId, pipelineId, pipelineRunId, jobId, headers, runtime);
}

model RetryVMDeployMachineResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model RetryVMDeployMachineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RetryVMDeployMachineResponseBody(name='body'),
}

/**
 * @summary 重试机器部署
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RetryVMDeployMachineResponse
 */
async function retryVMDeployMachineWithOptions(organizationId: string, pipelineId: string, deployOrderId: string, machineSn: string, headers: map[string]string, runtime: Util.RuntimeOptions): RetryVMDeployMachineResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'RetryVMDeployMachine',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/deploy/${OpenApiUtil.getEncodeParam(deployOrderId)}/machine/${OpenApiUtil.getEncodeParam(machineSn)}/retry`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 重试机器部署
 *
 * @return RetryVMDeployMachineResponse
 */
async function retryVMDeployMachine(organizationId: string, pipelineId: string, deployOrderId: string, machineSn: string): RetryVMDeployMachineResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return retryVMDeployMachineWithOptions(organizationId, pipelineId, deployOrderId, machineSn, headers, runtime);
}

model ReviewMergeRequestRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  draftCommentIds?: [ string ](name='draftCommentIds'),
  reviewComment?: string(name='reviewComment'),
  reviewOpinion?: string(name='reviewOpinion', description='This parameter is required.', example='PASS'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model ReviewMergeRequestResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model ReviewMergeRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReviewMergeRequestResponseBody(name='body'),
}

/**
 * @summary 提交变更请求的评审意见
 *
 * @param request ReviewMergeRequestRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReviewMergeRequestResponse
 */
async function reviewMergeRequestWithOptions(repositoryId: string, localId: string, request: ReviewMergeRequestRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ReviewMergeRequestResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.draftCommentIds)) {
    body['draftCommentIds'] = request.draftCommentIds;
  }
  if (!Util.isUnset(request.reviewComment)) {
    body['reviewComment'] = request.reviewComment;
  }
  if (!Util.isUnset(request.reviewOpinion)) {
    body['reviewOpinion'] = request.reviewOpinion;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ReviewMergeRequest',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/${OpenApiUtil.getEncodeParam(repositoryId)}/merge_requests/${OpenApiUtil.getEncodeParam(localId)}/submit_review_opinion`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 提交变更请求的评审意见
 *
 * @param request ReviewMergeRequestRequest
 * @return ReviewMergeRequestResponse
 */
async function reviewMergeRequest(repositoryId: string, localId: string, request: ReviewMergeRequestRequest): ReviewMergeRequestResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return reviewMergeRequestWithOptions(repositoryId, localId, request, headers, runtime);
}

model SkipPipelineJobRunResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model SkipPipelineJobRunResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SkipPipelineJobRunResponseBody(name='body'),
}

/**
 * @summary 跳过流水线任务运行
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return SkipPipelineJobRunResponse
 */
async function skipPipelineJobRunWithOptions(organizationId: string, pipelineId: string, pipelineRunId: string, jobId: string, headers: map[string]string, runtime: Util.RuntimeOptions): SkipPipelineJobRunResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'SkipPipelineJobRun',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/pipelineRuns/${OpenApiUtil.getEncodeParam(pipelineRunId)}/jobs/${OpenApiUtil.getEncodeParam(jobId)}/skip`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 跳过流水线任务运行
 *
 * @return SkipPipelineJobRunResponse
 */
async function skipPipelineJobRun(organizationId: string, pipelineId: string, pipelineRunId: string, jobId: string): SkipPipelineJobRunResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return skipPipelineJobRunWithOptions(organizationId, pipelineId, pipelineRunId, jobId, headers, runtime);
}

model SkipVMDeployMachineResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model SkipVMDeployMachineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SkipVMDeployMachineResponseBody(name='body'),
}

/**
 * @summary 跳过机器部署
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return SkipVMDeployMachineResponse
 */
async function skipVMDeployMachineWithOptions(organizationId: string, pipelineId: string, deployOrderId: string, machineSn: string, headers: map[string]string, runtime: Util.RuntimeOptions): SkipVMDeployMachineResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'SkipVMDeployMachine',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/deploy/${OpenApiUtil.getEncodeParam(deployOrderId)}/machine/${OpenApiUtil.getEncodeParam(machineSn)}/skip`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 跳过机器部署
 *
 * @return SkipVMDeployMachineResponse
 */
async function skipVMDeployMachine(organizationId: string, pipelineId: string, deployOrderId: string, machineSn: string): SkipVMDeployMachineResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return skipVMDeployMachineWithOptions(organizationId, pipelineId, deployOrderId, machineSn, headers, runtime);
}

model StartPipelineRunRequest {
  params?: string(name='params', example='{     "branchModeBranchs":[         "branch1",         "branch2"     ],     "envs":{         "k1":"v1",         "k2":"v2",         "k3":"v3"     },     "runningBranchs":{         "https://codeup.aliyun.com/60c1abb32c5969c370c5fcd0/Codeup-Demo.git":"master1"     },     "runningTags":{         "https://codeup.aliyun.com/60c1abb32c5969c370c5fcd0/Codeup-Demo.git":"1.0"     } }'),
}

model StartPipelineRunResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  pipelineRunId?: long(name='pipelineRunId', example='1'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model StartPipelineRunResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartPipelineRunResponseBody(name='body'),
}

/**
 * @summary 运行流水线
 *
 * @param request StartPipelineRunRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartPipelineRunResponse
 */
async function startPipelineRunWithOptions(organizationId: string, pipelineId: string, request: StartPipelineRunRequest, headers: map[string]string, runtime: Util.RuntimeOptions): StartPipelineRunResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.params)) {
    body['params'] = request.params;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartPipelineRun',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organizations/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/run`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 运行流水线
 *
 * @param request StartPipelineRunRequest
 * @return StartPipelineRunResponse
 */
async function startPipelineRun(organizationId: string, pipelineId: string, request: StartPipelineRunRequest): StartPipelineRunResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return startPipelineRunWithOptions(organizationId, pipelineId, request, headers, runtime);
}

model StopPipelineJobRunResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='"\\\\"'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model StopPipelineJobRunResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopPipelineJobRunResponseBody(name='body'),
}

/**
 * @summary 终止流水线任务运行
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopPipelineJobRunResponse
 */
async function stopPipelineJobRunWithOptions(organizationId: string, pipelineId: string, pipelineRunId: string, jobId: string, headers: map[string]string, runtime: Util.RuntimeOptions): StopPipelineJobRunResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'StopPipelineJobRun',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/pipelineRuns/${OpenApiUtil.getEncodeParam(pipelineRunId)}/jobs/${OpenApiUtil.getEncodeParam(jobId)}/stop`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 终止流水线任务运行
 *
 * @return StopPipelineJobRunResponse
 */
async function stopPipelineJobRun(organizationId: string, pipelineId: string, pipelineRunId: string, jobId: string): StopPipelineJobRunResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return stopPipelineJobRunWithOptions(organizationId, pipelineId, pipelineRunId, jobId, headers, runtime);
}

model StopPipelineRunResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model StopPipelineRunResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopPipelineRunResponseBody(name='body'),
}

/**
 * @summary 终止流水线运行
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopPipelineRunResponse
 */
async function stopPipelineRunWithOptions(organizationId: string, pipelineId: string, pipelineRunId: string, headers: map[string]string, runtime: Util.RuntimeOptions): StopPipelineRunResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'StopPipelineRun',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/pipelineRuns/${OpenApiUtil.getEncodeParam(pipelineRunId)}/stop`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 终止流水线运行
 *
 * @return StopPipelineRunResponse
 */
async function stopPipelineRun(organizationId: string, pipelineId: string, pipelineRunId: string): StopPipelineRunResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return stopPipelineRunWithOptions(organizationId, pipelineId, pipelineRunId, headers, runtime);
}

model StopVMDeployOrderResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model StopVMDeployOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopVMDeployOrderResponseBody(name='body'),
}

/**
 * @summary 取消部署单
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopVMDeployOrderResponse
 */
async function stopVMDeployOrderWithOptions(organizationId: string, pipelineId: string, deployOrderId: string, headers: map[string]string, runtime: Util.RuntimeOptions): StopVMDeployOrderResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'StopVMDeployOrder',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/deploy/${OpenApiUtil.getEncodeParam(deployOrderId)}/stop`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 取消部署单
 *
 * @return StopVMDeployOrderResponse
 */
async function stopVMDeployOrder(organizationId: string, pipelineId: string, deployOrderId: string): StopVMDeployOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return stopVMDeployOrderWithOptions(organizationId, pipelineId, deployOrderId, headers, runtime);
}

model TransferRepositoryRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  groupId?: string(name='groupId', description='This parameter is required.'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  repositoryId?: string(name='repositoryId', description='This parameter is required.'),
}

model TransferRepositoryResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    accessLevel?: int32(name='accessLevel', example='30'),
    archived?: boolean(name='archived', example='false'),
    createdAt?: string(name='createdAt', example='2022-01-14T21:08:26+08:00'),
    creatorId?: long(name='creatorId', example='19238'),
    demoProject?: boolean(name='demoProject', example='false'),
    description?: string(name='description'),
    encrypted?: boolean(name='encrypted', example='false'),
    id?: long(name='id', example='19285'),
    lastActivityAt?: string(name='lastActivityAt', example='2022-01-14T21:08:26+08:00'),
    name?: string(name='name', example='test-repo'),
    nameWithNamespace?: string(name='nameWithNamespace'),
    namespaceId?: long(name='namespaceId', example='100003'),
    path?: string(name='path', example='test-repo'),
    pathWithNamespace?: string(name='pathWithNamespace', example='codeup-test-org/test-create-codeup'),
    starCount?: long(name='starCount', example='0'),
    starred?: boolean(name='starred', example='true'),
    updatedAt?: string(name='updatedAt', example='2022-01-14T21:08:26+08:00'),
    visibilityLevel?: int32(name='visibilityLevel', example='0'),
    webUrl?: string(name='webUrl', example='""'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model TransferRepositoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TransferRepositoryResponseBody(name='body'),
}

/**
 * @summary 转移代码库
 *
 * @param request TransferRepositoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return TransferRepositoryResponse
 */
async function transferRepositoryWithOptions(request: TransferRepositoryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): TransferRepositoryResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.groupId)) {
    query['groupId'] = request.groupId;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryId)) {
    query['repositoryId'] = request.repositoryId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TransferRepository',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/repository/transfer`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 转移代码库
 *
 * @param request TransferRepositoryRequest
 * @return TransferRepositoryResponse
 */
async function transferRepository(request: TransferRepositoryRequest): TransferRepositoryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return transferRepositoryWithOptions(request, headers, runtime);
}

model TriggerRepositoryMirrorSyncRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  account?: string(name='account', example='test-account'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
  token?: string(name='token', example='asd12e44827fe2444f952e931e51xxxx'),
}

model TriggerRepositoryMirrorSyncResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_ILLEGAL_ARGUMENT_ERROR'),
  errorMessage?: string(name='errorMessage', example='企业不存在'),
  requestId?: string(name='requestId', example='37294673-00CA-5B8B-914F-A8B35511E90A'),
  result?: {
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model TriggerRepositoryMirrorSyncResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TriggerRepositoryMirrorSyncResponseBody(name='body'),
}

/**
 * @summary 触发仓库同步
 *
 * @param request TriggerRepositoryMirrorSyncRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return TriggerRepositoryMirrorSyncResponse
 */
async function triggerRepositoryMirrorSyncWithOptions(repositoryId: string, request: TriggerRepositoryMirrorSyncRequest, headers: map[string]string, runtime: Util.RuntimeOptions): TriggerRepositoryMirrorSyncResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.account)) {
    query['account'] = request.account;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.token)) {
    query['token'] = request.token;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TriggerRepositoryMirrorSync',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/mirror`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 触发仓库同步
 *
 * @param request TriggerRepositoryMirrorSyncRequest
 * @return TriggerRepositoryMirrorSyncResponse
 */
async function triggerRepositoryMirrorSync(repositoryId: string, request: TriggerRepositoryMirrorSyncRequest): TriggerRepositoryMirrorSyncResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return triggerRepositoryMirrorSyncWithOptions(repositoryId, request, headers, runtime);
}

model UpdateAppMemberRequest {
  player?: {
    id?: string(name='id', example='1332695887xxxxxx'),
    type?: string(name='type', example='User'),
  }(name='player'),
  roleNames?: [ string ](name='roleNames'),
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199fcd'),
}

model UpdateAppMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: string(name='body'),
}

/**
 * @summary 更新应用成员
 *
 * @param request UpdateAppMemberRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAppMemberResponse
 */
async function updateAppMemberWithOptions(appName: string, request: UpdateAppMemberRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateAppMemberResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.player)) {
    body['player'] = request.player;
  }
  if (!Util.isUnset(request.roleNames)) {
    body['roleNames'] = request.roleNames;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAppMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}/members`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'string',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新应用成员
 *
 * @param request UpdateAppMemberRequest
 * @return UpdateAppMemberResponse
 */
async function updateAppMember(appName: string, request: UpdateAppMemberRequest): UpdateAppMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateAppMemberWithOptions(appName, request, headers, runtime);
}

model UpdateApplicationRequest {
  ownerAccountId?: string(name='ownerAccountId', example='1332695887xxxxxx'),
  organizationId?: string(name='organizationId', example='66c0c9fffeb86b450c199fcd'),
}

model UpdateApplicationResponseBody = {
  creatorAccountId?: string(name='creatorAccountId', example='1332695887xxxxxx'),
  description?: string(name='description', example='应用描述'),
  gmtCreate?: string(name='gmtCreate', example='2024-01-01T00:00:00.000+00:00'),
  name?: string(name='name', example='testApp'),
  requestId?: string(name='requestId', example='FC93CE1A-8D7A-13A9-8306-7465DE2E5C0F'),
}

model UpdateApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateApplicationResponseBody(name='body'),
}

/**
 * @summary 更新应用
 *
 * @param request UpdateApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateApplicationResponse
 */
async function updateApplicationWithOptions(appName: string, request: UpdateApplicationRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateApplicationResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.ownerAccountId)) {
    body['ownerAccountId'] = request.ownerAccountId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateApplication',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/appstack/apps/${OpenApiUtil.getEncodeParam(appName)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新应用
 *
 * @param request UpdateApplicationRequest
 * @return UpdateApplicationResponse
 */
async function updateApplication(appName: string, request: UpdateApplicationRequest): UpdateApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateApplicationWithOptions(appName, request, headers, runtime);
}

model UpdateCheckRunRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  annotations?: [ 
    {
      annotationLevel?: string(name='annotationLevel', description='This parameter is required.', example='failure'),
      endColumn?: long(name='endColumn', example='5'),
      endLine?: long(name='endLine', description='This parameter is required.', example='2'),
      message?: string(name='message', description='This parameter is required.'),
      path?: string(name='path', description='This parameter is required.', example='demo/test.txt'),
      rawDetails?: string(name='rawDetails'),
      startColumn?: long(name='startColumn', example='3'),
      startLine?: long(name='startLine', description='This parameter is required.', example='1'),
      title?: string(name='title'),
    }
  ](name='annotations'),
  completedAt?: string(name='completedAt', example='2023-03-15T08:00:00Z'),
  conclusion?: string(name='conclusion', example='success'),
  detailsUrl?: string(name='detailsUrl', example='xx'),
  externalId?: string(name='externalId', example='42'),
  name?: string(name='name', example='my-check-ci'),
  output?: {
    images?: [ 
      {
        alt?: string(name='alt', description='This parameter is required.', example='test-image-alt'),
        caption?: string(name='caption', example='test'),
        imageUrl?: string(name='imageUrl', description='This parameter is required.', example='xxx'),
      }
    ](name='images'),
    summary?: string(name='summary', description='This parameter is required.'),
    text?: string(name='text'),
    title?: string(name='title', example='Mighty Readme report'),
  }(name='output'),
  startedAt?: string(name='startedAt', example='2023-03-15T08:00:00Z'),
  status?: string(name='status', example='completed'),
  checkRunId?: long(name='checkRunId', description='This parameter is required.', example='2'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
}

model UpdateCheckRunResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    annotations?: [ 
      {
        annotationLevel?: string(name='annotationLevel', example='warning'),
        endColumn?: long(name='endColumn', example='5'),
        endLine?: long(name='endLine', example='2'),
        id?: long(name='id', example='1'),
        message?: string(name='message'),
        path?: string(name='path', example='demo/test.txt'),
        rawDetails?: string(name='rawDetails'),
        startColumn?: long(name='startColumn', example='3'),
        startLine?: long(name='startLine', example='1'),
        title?: string(name='title'),
      }
    ](name='annotations'),
    checkSuite?: {
      id?: long(name='id', example='1'),
    }(name='checkSuite'),
    completedAt?: string(name='completedAt', example='2023-03-15T08:00:00Z'),
    conclusion?: string(name='conclusion', example='success'),
    createdAt?: string(name='createdAt', example='2022-01-14T21:08:26+08:00'),
    detailsUrl?: string(name='detailsUrl', example='xxx'),
    externalId?: string(name='externalId', example='42'),
    headSha?: string(name='headSha', example='40f4ccfe019cdd4a62d4acb0c57130106fc7e1be'),
    id?: long(name='id', example='524836'),
    name?: string(name='name', example='my-check-ci'),
    output?: {
      images?: [ 
        {
          alt?: string(name='alt', example='test-image-alt'),
          caption?: string(name='caption', example='test'),
          imageUrl?: string(name='imageUrl', example='xxx'),
        }
      ](name='images'),
      summary?: string(name='summary'),
      text?: string(name='text'),
      title?: string(name='title', example='Mighty Readme report'),
    }(name='output'),
    startedAt?: string(name='startedAt', example='2023-03-15T08:00:00Z'),
    status?: string(name='status', example='completed'),
    updatedAt?: string(name='updatedAt', example='2022-01-14T21:08:26+08:00'),
    writer?: {
      id?: string(name='id', example='xxx'),
      logoUrl?: string(name='logoUrl', example='xxx'),
      name?: string(name='name', example='test-codeup'),
      slug?: string(name='slug', example='test-codeup'),
      type?: string(name='type', example='User'),
    }(name='writer'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model UpdateCheckRunResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCheckRunResponseBody(name='body'),
}

/**
 * @summary 更新检查运行记录
 *
 * @param request UpdateCheckRunRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCheckRunResponse
 */
async function updateCheckRunWithOptions(request: UpdateCheckRunRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateCheckRunResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.checkRunId)) {
    query['checkRunId'] = request.checkRunId;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.annotations)) {
    body['annotations'] = request.annotations;
  }
  if (!Util.isUnset(request.completedAt)) {
    body['completedAt'] = request.completedAt;
  }
  if (!Util.isUnset(request.conclusion)) {
    body['conclusion'] = request.conclusion;
  }
  if (!Util.isUnset(request.detailsUrl)) {
    body['detailsUrl'] = request.detailsUrl;
  }
  if (!Util.isUnset(request.externalId)) {
    body['externalId'] = request.externalId;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.output)) {
    body['output'] = request.output;
  }
  if (!Util.isUnset(request.startedAt)) {
    body['startedAt'] = request.startedAt;
  }
  if (!Util.isUnset(request.status)) {
    body['status'] = request.status;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCheckRun',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/check_runs/update_check_run`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新检查运行记录
 *
 * @param request UpdateCheckRunRequest
 * @return UpdateCheckRunResponse
 */
async function updateCheckRun(request: UpdateCheckRunRequest): UpdateCheckRunResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateCheckRunWithOptions(request, headers, runtime);
}

model UpdateFileRequest {
  accessToken?: string(name='accessToken', example='0cf2c8458ac44d9481aab2dd6ec10596v3'),
  branchName?: string(name='branchName', description='This parameter is required.', example='master'),
  commitMessage?: string(name='commitMessage', description='This parameter is required.'),
  content?: string(name='content', description='This parameter is required.'),
  encoding?: string(name='encoding', example='text'),
  newPath?: string(name='newPath', description='This parameter is required.', example='src/main/update.txt'),
  oldPath?: string(name='oldPath', description='This parameter is required.', example='src/main/update.txt'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model UpdateFileResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='C2F153F6-BB43-50C4-9F4F-40593203E19A'),
  result?: {
    branchName?: string(name='branchName', example='master'),
    filePath?: string(name='filePath', example='src/main/update.txt'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model UpdateFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateFileResponseBody(name='body'),
}

/**
 * @summary 更新代码库文件
 *
 * @param request UpdateFileRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateFileResponse
 */
async function updateFileWithOptions(repositoryId: string, request: UpdateFileRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateFileResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.branchName)) {
    body['branchName'] = request.branchName;
  }
  if (!Util.isUnset(request.commitMessage)) {
    body['commitMessage'] = request.commitMessage;
  }
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.encoding)) {
    body['encoding'] = request.encoding;
  }
  if (!Util.isUnset(request.newPath)) {
    body['newPath'] = request.newPath;
  }
  if (!Util.isUnset(request.oldPath)) {
    body['oldPath'] = request.oldPath;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateFile',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/files/update`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新代码库文件
 *
 * @param request UpdateFileRequest
 * @return UpdateFileResponse
 */
async function updateFile(repositoryId: string, request: UpdateFileRequest): UpdateFileResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateFileWithOptions(repositoryId, request, headers, runtime);
}

model UpdateFlowTagRequest {
  color?: string(name='color', description='This parameter is required.', example='#1F9AEF'),
  flowTagGroupId?: long(name='flowTagGroupId', description='This parameter is required.', example='11'),
  name?: string(name='name', description='This parameter is required.'),
}

model UpdateFlowTagResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model UpdateFlowTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateFlowTagResponseBody(name='body'),
}

/**
 * @summary 更新标签
 *
 * @param request UpdateFlowTagRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateFlowTagResponse
 */
async function updateFlowTagWithOptions(organizationId: string, id: string, request: UpdateFlowTagRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateFlowTagResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.color)) {
    query['color'] = request.color;
  }
  if (!Util.isUnset(request.flowTagGroupId)) {
    query['flowTagGroupId'] = request.flowTagGroupId;
  }
  if (!Util.isUnset(request.name)) {
    query['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateFlowTag',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/flow/tags/${OpenApiUtil.getEncodeParam(id)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新标签
 *
 * @param request UpdateFlowTagRequest
 * @return UpdateFlowTagResponse
 */
async function updateFlowTag(organizationId: string, id: string, request: UpdateFlowTagRequest): UpdateFlowTagResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateFlowTagWithOptions(organizationId, id, request, headers, runtime);
}

model UpdateFlowTagGroupRequest {
  name?: string(name='name', description='This parameter is required.'),
}

model UpdateFlowTagGroupResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model UpdateFlowTagGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateFlowTagGroupResponseBody(name='body'),
}

/**
 * @summary 标签分类
 *
 * @param request UpdateFlowTagGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateFlowTagGroupResponse
 */
async function updateFlowTagGroupWithOptions(organizationId: string, id: string, request: UpdateFlowTagGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateFlowTagGroupResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    query['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateFlowTagGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/flow/tagGroups/${OpenApiUtil.getEncodeParam(id)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 标签分类
 *
 * @param request UpdateFlowTagGroupRequest
 * @return UpdateFlowTagGroupResponse
 */
async function updateFlowTagGroup(organizationId: string, id: string, request: UpdateFlowTagGroupRequest): UpdateFlowTagGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateFlowTagGroupWithOptions(organizationId, id, request, headers, runtime);
}

model UpdateGroupRequest {
  accessToken?: string(name='accessToken', example='f0b1e61dxxxxxxx975a93f9129d2513'),
  avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
  description?: string(name='description'),
  name?: string(name='name', description='This parameter is required.', example='codeup_group'),
  path?: string(name='path', description='This parameter is required.', example='codeup_group'),
  pathWithNamespace?: string(name='pathWithNamespace', description='This parameter is required.', example='org/group/subgroup/here'),
  visibilityLevel?: int32(name='visibilityLevel', example='10'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='1e9903d8b3f1xxxxxf9286ef5'),
}

model UpdateGroupResponseBody = {
  errorCode?: string(name='errorCode', example='success'),
  errorMessage?: string(name='errorMessage', example='InvalidParam.NoPermission'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c4ef67f1bea827c4/w/100/h/100'),
    description?: string(name='description'),
    id?: long(name='id', example='30815'),
    name?: string(name='name', example='codeup'),
    nameWithNamespace?: string(name='nameWithNamespace'),
    ownerId?: long(name='ownerId', example='19230'),
    parentId?: long(name='parentId', example='26842'),
    path?: string(name='path', example='test-codeup'),
    pathWithNamespace?: string(name='pathWithNamespace', example='codeup-test-org/test-codeup'),
    type?: string(name='type', example='Group'),
    visibilityLevel?: int32(name='visibilityLevel', example='10'),
    webUrl?: string(name='webUrl', example='""'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model UpdateGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateGroupResponseBody(name='body'),
}

/**
 * @summary 更新单个代码组信息
 *
 * @param request UpdateGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateGroupResponse
 */
async function updateGroupWithOptions(request: UpdateGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateGroupResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.avatarUrl)) {
    body['avatarUrl'] = request.avatarUrl;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.path)) {
    body['path'] = request.path;
  }
  if (!Util.isUnset(request.pathWithNamespace)) {
    body['pathWithNamespace'] = request.pathWithNamespace;
  }
  if (!Util.isUnset(request.visibilityLevel)) {
    body['visibilityLevel'] = request.visibilityLevel;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/groups/modify`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新单个代码组信息
 *
 * @param request UpdateGroupRequest
 * @return UpdateGroupResponse
 */
async function updateGroup(request: UpdateGroupRequest): UpdateGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateGroupWithOptions(request, headers, runtime);
}

model UpdateGroupMemberRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  aliyunPk?: string(name='aliyunPk', description='This parameter is required.', example='1789095186553536'),
  accessLevel?: int32(name='accessLevel', description='This parameter is required.', example='30'),
  memberType?: string(name='memberType', example='USERS'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='632bbfdf419338aaa2b1360a'),
}

model UpdateGroupMemberResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    accessLevel?: int32(name='accessLevel', example='30'),
    avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
    email?: string(name='email', example='username@example.com'),
    id?: long(name='id', example='24661'),
    memberType?: string(name='memberType', example='USERS'),
    name?: string(name='name', example='codeup'),
    sourceId?: long(name='sourceId', example='223241'),
    state?: string(name='state', example='active'),
    username?: string(name='username', example='test-codeup'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model UpdateGroupMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateGroupMemberResponseBody(name='body'),
}

/**
 * @summary 修改组成员
 *
 * @param request UpdateGroupMemberRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateGroupMemberResponse
 */
async function updateGroupMemberWithOptions(groupId: string, request: UpdateGroupMemberRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateGroupMemberResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.aliyunPk)) {
    query['aliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.accessLevel)) {
    body['accessLevel'] = request.accessLevel;
  }
  if (!Util.isUnset(request.memberType)) {
    body['memberType'] = request.memberType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateGroupMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/groups/${OpenApiUtil.getEncodeParam(groupId)}/members/update/aliyun_pk`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改组成员
 *
 * @param request UpdateGroupMemberRequest
 * @return UpdateGroupMemberResponse
 */
async function updateGroupMember(groupId: string, request: UpdateGroupMemberRequest): UpdateGroupMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateGroupMemberWithOptions(groupId, request, headers, runtime);
}

model UpdateHostGroupRequest {
  aliyunRegion?: string(name='aliyunRegion', example='cn-hangzhou'),
  ecsLabelKey?: string(name='ecsLabelKey', example='ecs'),
  ecsLabelValue?: string(name='ecsLabelValue', example='ecs'),
  ecsType?: string(name='ecsType', example='ECS_ALIYUN'),
  envId?: string(name='envId', example='0'),
  machineInfos?: string(name='machineInfos', example='[{"aliyunRegionId":"cn-beijing","machineSn":"i-sssssss","instanceName":"ceshi","ip":"120.0.0.0"}]'),
  name?: string(name='name', description='This parameter is required.'),
  serviceConnectionId?: long(name='serviceConnectionId', description='This parameter is required.', example='123'),
  tagIds?: string(name='tagIds', example='12,23'),
  type?: string(name='type', description='This parameter is required.', example='ECS'),
}

model UpdateHostGroupResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model UpdateHostGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateHostGroupResponseBody(name='body'),
}

/**
 * @summary 更新主机组
 *
 * @param request UpdateHostGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateHostGroupResponse
 */
async function updateHostGroupWithOptions(organizationId: string, id: string, request: UpdateHostGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateHostGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aliyunRegion)) {
    body['aliyunRegion'] = request.aliyunRegion;
  }
  if (!Util.isUnset(request.ecsLabelKey)) {
    body['ecsLabelKey'] = request.ecsLabelKey;
  }
  if (!Util.isUnset(request.ecsLabelValue)) {
    body['ecsLabelValue'] = request.ecsLabelValue;
  }
  if (!Util.isUnset(request.ecsType)) {
    body['ecsType'] = request.ecsType;
  }
  if (!Util.isUnset(request.envId)) {
    body['envId'] = request.envId;
  }
  if (!Util.isUnset(request.machineInfos)) {
    body['machineInfos'] = request.machineInfos;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.serviceConnectionId)) {
    body['serviceConnectionId'] = request.serviceConnectionId;
  }
  if (!Util.isUnset(request.tagIds)) {
    body['tagIds'] = request.tagIds;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateHostGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/hostGroups/${OpenApiUtil.getEncodeParam(id)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新主机组
 *
 * @param request UpdateHostGroupRequest
 * @return UpdateHostGroupResponse
 */
async function updateHostGroup(organizationId: string, id: string, request: UpdateHostGroupRequest): UpdateHostGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateHostGroupWithOptions(organizationId, id, request, headers, runtime);
}

model UpdateMergeRequestRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  description?: string(name='description'),
  title?: string(name='title'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
}

model UpdateMergeRequestResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: {
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model UpdateMergeRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateMergeRequestResponseBody(name='body'),
}

/**
 * @summary 更新代码评审的标题和描述
 *
 * @param request UpdateMergeRequestRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateMergeRequestResponse
 */
async function updateMergeRequestWithOptions(repositoryId: string, localId: string, request: UpdateMergeRequestRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateMergeRequestResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.title)) {
    body['title'] = request.title;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateMergeRequest',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/${OpenApiUtil.getEncodeParam(repositoryId)}/merge_requests/${OpenApiUtil.getEncodeParam(localId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新代码评审的标题和描述
 *
 * @param request UpdateMergeRequestRequest
 * @return UpdateMergeRequestResponse
 */
async function updateMergeRequest(repositoryId: string, localId: string, request: UpdateMergeRequestRequest): UpdateMergeRequestResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateMergeRequestWithOptions(repositoryId, localId, request, headers, runtime);
}

model UpdateMergeRequestPersonnelRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  newUserIdList?: [ string ](name='newUserIdList'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
}

model UpdateMergeRequestPersonnelResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='4D6AF7CC-B43B-5454-86AB-023D25E44868'),
  result?: {
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model UpdateMergeRequestPersonnelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateMergeRequestPersonnelResponseBody(name='body'),
}

/**
 * @summary 更新代码评审的干系人
 *
 * @param request UpdateMergeRequestPersonnelRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateMergeRequestPersonnelResponse
 */
async function updateMergeRequestPersonnelWithOptions(repositoryId: string, localId: string, personType: string, request: UpdateMergeRequestPersonnelRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateMergeRequestPersonnelResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.newUserIdList)) {
    body['newUserIdList'] = request.newUserIdList;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateMergeRequestPersonnel',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/${OpenApiUtil.getEncodeParam(repositoryId)}/merge_requests/${OpenApiUtil.getEncodeParam(localId)}/person/${OpenApiUtil.getEncodeParam(personType)}`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新代码评审的干系人
 *
 * @param request UpdateMergeRequestPersonnelRequest
 * @return UpdateMergeRequestPersonnelResponse
 */
async function updateMergeRequestPersonnel(repositoryId: string, localId: string, personType: string, request: UpdateMergeRequestPersonnelRequest): UpdateMergeRequestPersonnelResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateMergeRequestPersonnelWithOptions(repositoryId, localId, personType, request, headers, runtime);
}

model UpdateOrganizationMemberRequest {
  organizationMemberName?: string(name='organizationMemberName', description='This parameter is required.'),
}

model UpdateOrganizationMemberResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  member?: {
    accountId?: string(name='accountId', example='292035769476261xxx'),
    organizationMemberName?: string(name='organizationMemberName'),
  }(name='member'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  success?: boolean(name='success', example='true'),
}

model UpdateOrganizationMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateOrganizationMemberResponseBody(name='body'),
}

/**
 * @summary 当前用户加入的企业列表
 *
 * @param request UpdateOrganizationMemberRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateOrganizationMemberResponse
 */
async function updateOrganizationMemberWithOptions(organizationId: string, accountId: string, request: UpdateOrganizationMemberRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateOrganizationMemberResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationMemberName)) {
    query['organizationMemberName'] = request.organizationMemberName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateOrganizationMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/members/${OpenApiUtil.getEncodeParam(accountId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 当前用户加入的企业列表
 *
 * @param request UpdateOrganizationMemberRequest
 * @return UpdateOrganizationMemberResponse
 */
async function updateOrganizationMember(organizationId: string, accountId: string, request: UpdateOrganizationMemberRequest): UpdateOrganizationMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateOrganizationMemberWithOptions(organizationId, accountId, request, headers, runtime);
}

model UpdatePipelineRequest {
  content?: string(name='content', description='This parameter is required.'),
  name?: string(name='name', description='This parameter is required.'),
  pipelineId?: string(name='pipelineId', description='This parameter is required.', example='111xxx'),
}

model UpdatePipelineResponseBody = {
  errorCode?: string(name='errorCode'),
  errorMessage?: string(name='errorMessage'),
  requestId?: string(name='requestId'),
  success?: boolean(name='success', example='true'),
}

model UpdatePipelineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePipelineResponseBody(name='body'),
}

/**
 * @summary 更新流水线。
 *
 * @param request UpdatePipelineRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePipelineResponse
 */
async function updatePipelineWithOptions(organizationId: string, request: UpdatePipelineRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdatePipelineResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.pipelineId)) {
    body['pipelineId'] = request.pipelineId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePipeline',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新流水线。
 *
 * @param request UpdatePipelineRequest
 * @return UpdatePipelineResponse
 */
async function updatePipeline(organizationId: string, request: UpdatePipelineRequest): UpdatePipelineResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updatePipelineWithOptions(organizationId, request, headers, runtime);
}

model UpdatePipelineBaseInfoRequest {
  envId?: long(name='envId', example='0'),
  pipelineName?: string(name='pipelineName', description='This parameter is required.'),
  tagList?: string(name='tagList', example='"11,222,33"'),
}

model UpdatePipelineBaseInfoResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true 接口调用成功，false 接口调用失败'),
}

model UpdatePipelineBaseInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePipelineBaseInfoResponseBody(name='body'),
}

/**
 * @summary 删除标签
 *
 * @param request UpdatePipelineBaseInfoRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePipelineBaseInfoResponse
 */
async function updatePipelineBaseInfoWithOptions(organizationId: string, pipelineId: string, request: UpdatePipelineBaseInfoRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdatePipelineBaseInfoResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.envId)) {
    query['envId'] = request.envId;
  }
  if (!Util.isUnset(request.pipelineName)) {
    query['pipelineName'] = request.pipelineName;
  }
  if (!Util.isUnset(request.tagList)) {
    query['tagList'] = request.tagList;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePipelineBaseInfo',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelines/${OpenApiUtil.getEncodeParam(pipelineId)}/baseInfo`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除标签
 *
 * @param request UpdatePipelineBaseInfoRequest
 * @return UpdatePipelineBaseInfoResponse
 */
async function updatePipelineBaseInfo(organizationId: string, pipelineId: string, request: UpdatePipelineBaseInfoRequest): UpdatePipelineBaseInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updatePipelineBaseInfoWithOptions(organizationId, pipelineId, request, headers, runtime);
}

model UpdatePipelineGroupRequest {
  name?: string(name='name', description='This parameter is required.'),
}

model UpdatePipelineGroupResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model UpdatePipelineGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePipelineGroupResponseBody(name='body'),
}

/**
 * @summary 更新流水线分组
 *
 * @param request UpdatePipelineGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePipelineGroupResponse
 */
async function updatePipelineGroupWithOptions(organizationId: string, groupId: string, request: UpdatePipelineGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdatePipelineGroupResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    query['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePipelineGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/pipelineGroups/${OpenApiUtil.getEncodeParam(groupId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新流水线分组
 *
 * @param request UpdatePipelineGroupRequest
 * @return UpdatePipelineGroupResponse
 */
async function updatePipelineGroup(organizationId: string, groupId: string, request: UpdatePipelineGroupRequest): UpdatePipelineGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updatePipelineGroupWithOptions(organizationId, groupId, request, headers, runtime);
}

model UpdateProjectFieldRequest {
  statusIdentifier?: string(name='statusIdentifier', example='fdsaadsfasxxxxdddd'),
  updateBasicFieldRequestList?: [ 
    {
      propertyKey?: string(name='propertyKey', example='name'),
      propertyValue?: string(name='propertyValue'),
    }
  ](name='updateBasicFieldRequestList'),
  updateForOpenApiList?: [ 
    {
      fieldIdentifier?: string(name='fieldIdentifier', example='c4fd21xxxxxxxx9oj8jk'),
      value?: string(name='value'),
    }
  ](name='updateForOpenApiList'),
}

model UpdateProjectFieldResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='errormessage'),
  project?: {
    category?: string(name='category', example='Project'),
    categoryIdentifier?: string(name='categoryIdentifier', example='Project'),
    creator?: string(name='creator', example='19xx7043xxxxxxx914'),
    customCode?: string(name='customCode', example='OJAY'),
    description?: string(name='description'),
    fieldList?: [ 
      {
        displayName?: string(name='displayName'),
        identifier?: string(name='identifier', example='b787ff504c0b36f8b71d15a4fd'),
        value?: string(name='value', example='ace3wxxxxxxx7rff3ee'),
        valueType?: string(name='valueType', example='user'),
      }
    ](name='fieldList'),
    gmtCreate?: long(name='gmtCreate', example='1623916393000'),
    gmtModified?: long(name='gmtModified', example='1684134690000'),
    icon?: string(name='icon', example='https://xxxxxx.png'),
    iconBig?: string(name='iconBig', example='https://xxxxxx.png'),
    iconGroup?: string(name='iconGroup', example='{"small":"https://xxxxxx.png","big":"https://img.yyyyyy.png"}'),
    iconSmall?: string(name='iconSmall', example='https://img.yyyyyy.png'),
    id?: string(name='id', example='66893'),
    identifier?: string(name='identifier', example='1e2ea73d24652d5874d001b351'),
    identifierPath?: string(name='identifierPath', example='e8b2xxxxxx2abdxxxxxxxx23'),
    logicalStatus?: string(name='logicalStatus', example='NORMAL'),
    modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
    name?: string(name='name'),
    organizationIdentifier?: string(name='organizationIdentifier', example='5e70xxxxxxcd000xxxxe96'),
    parentIdentifier?: string(name='parentIdentifier', example='null'),
    scope?: string(name='scope', example='public'),
    statusIdentifier?: string(name='statusIdentifier', example='8a40xxxxxxxxxxxxx64'),
    statusName?: string(name='statusName'),
    statusStageIdentifier?: string(name='statusStageIdentifier', example='8a4058a71159b68254......'),
    subType?: string(name='subType', example='null'),
    typeIdentifier?: string(name='typeIdentifier', example='CustomProject'),
  }(name='project'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', description='true/false', example='True'),
}

model UpdateProjectFieldResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProjectFieldResponseBody(name='body'),
}

/**
 * @summary 更新项目属性与字段
 *
 * @param request UpdateProjectFieldRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProjectFieldResponse
 */
async function updateProjectFieldWithOptions(organizationId: string, identifier: string, request: UpdateProjectFieldRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProjectFieldResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.statusIdentifier)) {
    body['statusIdentifier'] = request.statusIdentifier;
  }
  if (!Util.isUnset(request.updateBasicFieldRequestList)) {
    body['updateBasicFieldRequestList'] = request.updateBasicFieldRequestList;
  }
  if (!Util.isUnset(request.updateForOpenApiList)) {
    body['updateForOpenApiList'] = request.updateForOpenApiList;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProjectField',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/project/${OpenApiUtil.getEncodeParam(identifier)}`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新项目属性与字段
 *
 * @param request UpdateProjectFieldRequest
 * @return UpdateProjectFieldResponse
 */
async function updateProjectField(organizationId: string, identifier: string, request: UpdateProjectFieldRequest): UpdateProjectFieldResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProjectFieldWithOptions(organizationId, identifier, request, headers, runtime);
}

model UpdateProjectLabelRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  color?: string(name='color', example='#EF433B'),
  description?: string(name='description'),
  name?: string(name='name'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  repositoryIdentity?: string(name='repositoryIdentity', description='This parameter is required.'),
}

model UpdateProjectLabelResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  result?: {
    color?: string(name='color', example='#EF433B'),
    description?: string(name='description'),
    id?: string(name='id', example='8d84d73cf315473683400760f02dbfc1'),
    name?: string(name='name'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model UpdateProjectLabelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProjectLabelResponseBody(name='body'),
}

/**
 * @summary 更新代码库Label
 *
 * @param request UpdateProjectLabelRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProjectLabelResponse
 */
async function updateProjectLabelWithOptions(labelId: string, request: UpdateProjectLabelRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProjectLabelResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.repositoryIdentity)) {
    query['repositoryIdentity'] = request.repositoryIdentity;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.color)) {
    body['color'] = request.color;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProjectLabel',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/labels/${OpenApiUtil.getEncodeParam(labelId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新代码库Label
 *
 * @param request UpdateProjectLabelRequest
 * @return UpdateProjectLabelResponse
 */
async function updateProjectLabel(labelId: string, request: UpdateProjectLabelRequest): UpdateProjectLabelResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProjectLabelWithOptions(labelId, request, headers, runtime);
}

model UpdateProjectMemberRequest {
  roleIdentifier?: string(name='roleIdentifier', description='This parameter is required.', example='project.admin'),
  targetIdentifier?: string(name='targetIdentifier', description='This parameter is required.', example='5e70xxxxxxcd000xxxxe96'),
  targetType?: string(name='targetType', description='This parameter is required.', example='Space'),
  userIdentifier?: string(name='userIdentifier', description='This parameter is required.', example='19xx7043xxxxxxx914'),
  userType?: string(name='userType', description='This parameter is required.', example='user'),
}

model UpdateProjectMemberResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  member?: {
    gmtCreate?: long(name='gmtCreate', example='1623916393000'),
    gmtModified?: long(name='gmtModified', example='1623916393000'),
    id?: string(name='id', example='1124382'),
    roleIdentifier?: string(name='roleIdentifier', example='project.admin'),
    targetIdentifier?: string(name='targetIdentifier', example='5e70xxxxxxcd000xxxxe96'),
    targetType?: string(name='targetType', example='Space'),
    userIdentifier?: string(name='userIdentifier', example='19xx7043xxxxxxx914'),
    userType?: string(name='userType', example='user'),
  }(name='member'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model UpdateProjectMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProjectMemberResponseBody(name='body'),
}

/**
 * @summary 添加项目成员
 *
 * @param request UpdateProjectMemberRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProjectMemberResponse
 */
async function updateProjectMemberWithOptions(organizationId: string, projectId: string, request: UpdateProjectMemberRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProjectMemberResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.roleIdentifier)) {
    body['roleIdentifier'] = request.roleIdentifier;
  }
  if (!Util.isUnset(request.targetIdentifier)) {
    body['targetIdentifier'] = request.targetIdentifier;
  }
  if (!Util.isUnset(request.targetType)) {
    body['targetType'] = request.targetType;
  }
  if (!Util.isUnset(request.userIdentifier)) {
    body['userIdentifier'] = request.userIdentifier;
  }
  if (!Util.isUnset(request.userType)) {
    body['userType'] = request.userType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProjectMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/projects/${OpenApiUtil.getEncodeParam(projectId)}/updateMember`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 添加项目成员
 *
 * @param request UpdateProjectMemberRequest
 * @return UpdateProjectMemberResponse
 */
async function updateProjectMember(organizationId: string, projectId: string, request: UpdateProjectMemberRequest): UpdateProjectMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProjectMemberWithOptions(organizationId, projectId, request, headers, runtime);
}

model UpdateProtectedBranchesRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  allowMergeRoles?: [ int32 ](name='allowMergeRoles'),
  allowMergeUserIds?: [ string ](name='allowMergeUserIds'),
  allowPushRoles?: [ int32 ](name='allowPushRoles'),
  allowPushUserIds?: [ string ](name='allowPushUserIds'),
  branch?: string(name='branch', example='master'),
  id?: long(name='id', example='19224'),
  mergeRequestSetting?: {
    allowMergeRequestRoles?: [ int32 ](name='allowMergeRequestRoles'),
    defaultAssignees?: [ string ](name='defaultAssignees'),
    isAllowSelfApproval?: boolean(name='isAllowSelfApproval', example='true'),
    isRequireDiscussionProcessed?: boolean(name='isRequireDiscussionProcessed', example='true'),
    isRequired?: boolean(name='isRequired', example='true'),
    isResetApprovalWhenNewPush?: boolean(name='isResetApprovalWhenNewPush', example='false'),
    minimumApproval?: int32(name='minimumApproval', example='1'),
    mrMode?: string(name='mrMode', example='general'),
    whiteList?: string(name='whiteList', example='**.java'),
  }(name='mergeRequestSetting'),
  testSettingDTO?: {
    checkConfig?: {
      checkItems?: [ 
        {
          isRequired?: boolean(name='isRequired', example='false'),
          name?: string(name='name'),
        }
      ](name='checkItems'),
    }(name='checkConfig'),
    checkTaskQualityConfig?: {
      bizNo?: string(name='bizNo', example='123456'),
      enabled?: boolean(name='enabled', example='false'),
      message?: string(name='message', example='test_task_quality'),
      taskName?: string(name='taskName', example='bz-task-quality'),
    }(name='checkTaskQualityConfig'),
    codeGuidelinesDetection?: {
      enabled?: boolean(name='enabled', example='false'),
      message?: string(name='message', example='test_code_guide_lines'),
    }(name='codeGuidelinesDetection'),
    isRequired?: boolean(name='isRequired', example='false'),
    sensitiveInfoDetection?: {
      enabled?: boolean(name='enabled', example='false'),
      message?: string(name='message', example='test_code_sensitive_info'),
    }(name='sensitiveInfoDetection'),
  }(name='testSettingDTO'),
  organizationId?: string(name='organizationId', example='f0b1e61db5961df5975a93f9129d2513'),
}

model UpdateProtectedBranchesResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='A35869D5-BB29-5F84-A4DD-B09985EA2AFA'),
  result?: {
    allowMergeRoles?: [ int32 ](name='allowMergeRoles'),
    allowMergeUserIds?: [ long ](name='allowMergeUserIds'),
    allowPushRoles?: [ int32 ](name='allowPushRoles'),
    allowPushUserIds?: [ long ](name='allowPushUserIds'),
    branch?: string(name='branch', example='master'),
    id?: long(name='id', example='123456'),
    mergeRequestSetting?: {
      allowMergeRequestRoles?: [ int32 ](name='allowMergeRequestRoles'),
      defaultAssignees?: [ string ](name='defaultAssignees'),
      isAllowSelfApproval?: boolean(name='isAllowSelfApproval', example='true'),
      isRequireDiscussionProcessed?: boolean(name='isRequireDiscussionProcessed', example='true'),
      isRequired?: boolean(name='isRequired', example='true'),
      isResetApprovalWhenNewPush?: boolean(name='isResetApprovalWhenNewPush', example='false'),
      minimumApproval?: int32(name='minimumApproval', example='1'),
      mrMode?: string(name='mrMode', example='general'),
      whiteList?: string(name='whiteList', example='**.java'),
    }(name='mergeRequestSetting'),
    testSettingDTO?: {
      checkConfig?: {
        checkItems?: [ 
          {
            isRequired?: boolean(name='isRequired', example='false'),
            name?: string(name='name'),
          }
        ](name='checkItems'),
      }(name='checkConfig'),
      checkTaskQualityConfig?: {
        bizNo?: string(name='bizNo', example='123456'),
        enabled?: boolean(name='enabled', example='false'),
        message?: string(name='message', example='test_task_quality'),
        taskName?: string(name='taskName', example='biz-task-quality'),
      }(name='checkTaskQualityConfig'),
      codeGuidelinesDetection?: {
        enabled?: boolean(name='enabled', example='false'),
        message?: string(name='message', example='test_code_guide_lines'),
      }(name='codeGuidelinesDetection'),
      isRequired?: boolean(name='isRequired', example='false'),
      sensitiveInfoDetection?: {
        enabled?: boolean(name='enabled', example='false'),
        message?: string(name='message', example='test_code_sensitive_info'),
      }(name='sensitiveInfoDetection'),
    }(name='testSettingDTO'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model UpdateProtectedBranchesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProtectedBranchesResponseBody(name='body'),
}

/**
 * @summary 更改保护分支设置
 *
 * @param request UpdateProtectedBranchesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProtectedBranchesResponse
 */
async function updateProtectedBranchesWithOptions(repositoryId: string, id: string, request: UpdateProtectedBranchesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProtectedBranchesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.allowMergeRoles)) {
    body['allowMergeRoles'] = request.allowMergeRoles;
  }
  if (!Util.isUnset(request.allowMergeUserIds)) {
    body['allowMergeUserIds'] = request.allowMergeUserIds;
  }
  if (!Util.isUnset(request.allowPushRoles)) {
    body['allowPushRoles'] = request.allowPushRoles;
  }
  if (!Util.isUnset(request.allowPushUserIds)) {
    body['allowPushUserIds'] = request.allowPushUserIds;
  }
  if (!Util.isUnset(request.branch)) {
    body['branch'] = request.branch;
  }
  if (!Util.isUnset(request.id)) {
    body['id'] = request.id;
  }
  if (!Util.isUnset(request.mergeRequestSetting)) {
    body['mergeRequestSetting'] = request.mergeRequestSetting;
  }
  if (!Util.isUnset(request.testSettingDTO)) {
    body['testSettingDTO'] = request.testSettingDTO;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProtectedBranches',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(repositoryId)}/protect_branches/${OpenApiUtil.getEncodeParam(id)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更改保护分支设置
 *
 * @param request UpdateProtectedBranchesRequest
 * @return UpdateProtectedBranchesResponse
 */
async function updateProtectedBranches(repositoryId: string, id: string, request: UpdateProtectedBranchesRequest): UpdateProtectedBranchesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProtectedBranchesWithOptions(repositoryId, id, request, headers, runtime);
}

model UpdatePushReviewOnOffRequest {
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
  trunkMode?: boolean(name='trunkMode', description='This parameter is required.', example='true'),
}

model UpdatePushReviewOnOffResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='6177543A-8D54-5736-A93B-E0195A1512CB'),
  result?: {
    result?: boolean(name='result', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model UpdatePushReviewOnOffResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePushReviewOnOffResponseBody(name='body'),
}

/**
 * @summary 推送评审模式开关
 *
 * @param request UpdatePushReviewOnOffRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePushReviewOnOffResponse
 */
async function updatePushReviewOnOffWithOptions(repositoryId: string, request: UpdatePushReviewOnOffRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdatePushReviewOnOffResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }
  if (!Util.isUnset(request.trunkMode)) {
    query['trunkMode'] = request.trunkMode;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePushReviewOnOff',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/settings/trunk_mode`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 推送评审模式开关
 *
 * @param request UpdatePushReviewOnOffRequest
 * @return UpdatePushReviewOnOffResponse
 */
async function updatePushReviewOnOff(repositoryId: string, request: UpdatePushReviewOnOffRequest): UpdatePushReviewOnOffResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updatePushReviewOnOffWithOptions(repositoryId, request, headers, runtime);
}

model UpdatePushRuleRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  ruleInfos?: [ 
    {
      checkerName?: string(name='checkerName', example='CommitAuthorChecker'),
      checkerType?: string(name='checkerType', example='warn'),
      extraMessage?: string(name='extraMessage', example='on'),
      fileRuleRegexes?: [ string ](name='fileRuleRegexes'),
    }
  ](name='ruleInfos'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='5ebbc0228123212b59xxxxx'),
}

model UpdatePushRuleResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  result?: {
    gmtCreate?: string(name='gmtCreate', example='2023-09-03T18:20:06+08:00'),
    gmtModified?: string(name='gmtModified', example='2023-09-03T18:20:06+08:00'),
    id?: long(name='id'),
    ruleInfos?: [ 
      {
        checkerName?: string(name='checkerName', example='CommitAuthorChecker'),
        checkerType?: string(name='checkerType', example='warn'),
        extraMessage?: string(name='extraMessage', example='on'),
        fileRuleRegexes?: [ string ](name='fileRuleRegexes'),
      }
    ](name='ruleInfos'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model UpdatePushRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePushRuleResponseBody(name='body'),
}

/**
 * @summary 更新推送规则
 *
 * @param request UpdatePushRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePushRuleResponse
 */
async function updatePushRuleWithOptions(repositoryId: string, pushRuleId: string, request: UpdatePushRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdatePushRuleResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.ruleInfos)) {
    body['ruleInfos'] = request.ruleInfos;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePushRule',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/api/v4/projects/${OpenApiUtil.getEncodeParam(repositoryId)}/push_rule/${OpenApiUtil.getEncodeParam(pushRuleId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新推送规则
 *
 * @param request UpdatePushRuleRequest
 * @return UpdatePushRuleResponse
 */
async function updatePushRule(repositoryId: string, pushRuleId: string, request: UpdatePushRuleRequest): UpdatePushRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updatePushRuleWithOptions(repositoryId, pushRuleId, request, headers, runtime);
}

model UpdateRepositoryRequest {
  accessToken?: string(name='accessToken', example='c3c09f1230187a879678da43c973d069'),
  adminSettingLanguage?: string(name='adminSettingLanguage', example='Java'),
  avatar?: string(name='avatar', example='https://xxxx'),
  buildsEnabled?: boolean(name='buildsEnabled', example='true'),
  checkEmail?: boolean(name='checkEmail', example='true'),
  defaultBranch?: string(name='defaultBranch', example='master'),
  description?: string(name='description'),
  id?: long(name='id', example='2080398'),
  issuesEnabled?: boolean(name='issuesEnabled', example='true'),
  mergeRequestsEnabled?: boolean(name='mergeRequestsEnabled', example='true'),
  name?: string(name='name', example='codeup'),
  openCloneDownloadControl?: boolean(name='openCloneDownloadControl', example='false'),
  path?: string(name='path'),
  projectCloneDownloadMethodList?: [ 
    {
      allowed?: boolean(name='allowed', example='true'),
      permissionCode?: string(name='permissionCode', example='project:download'),
    }
  ](name='projectCloneDownloadMethodList'),
  projectCloneDownloadRoleList?: [ 
    {
      allowed?: boolean(name='allowed', example='true'),
      roleCode?: int32(name='roleCode', example='15'),
    }
  ](name='projectCloneDownloadRoleList'),
  snippetsEnabled?: boolean(name='snippetsEnabled', example='false'),
  visibilityLevel?: int32(name='visibilityLevel', example='0'),
  wikiEnabled?: boolean(name='wikiEnabled', example='true'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model UpdateRepositoryResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='“”'),
  requestId?: string(name='requestId', example='EAE03103-5497-58D1-9169-E524DDE8604C'),
  result?: {
    archived?: boolean(name='archived', example='false'),
    avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
    buildsEnabled?: boolean(name='buildsEnabled', example='false'),
    createdAt?: string(name='createdAt', example='2022-03-18 14:24:54'),
    creatorId?: long(name='creatorId', example='19238'),
    defaultBranch?: string(name='defaultBranch', example='master'),
    description?: string(name='description'),
    httpUrlToRepo?: string(name='httpUrlToRepo', example='https://codeup.aliyun.com/xxx/test/test.git'),
    id?: long(name='id', example='2825387'),
    issuesEnabled?: boolean(name='issuesEnabled', example='true'),
    lastActivityAt?: string(name='lastActivityAt', example='2022-03-20 14:24:54'),
    mergeRequestsEnabled?: boolean(name='mergeRequestsEnabled', example='true'),
    name?: string(name='name', example='codeup'),
    nameWithNamespace?: string(name='nameWithNamespace'),
    namespace?: {
      avatar?: string(name='avatar', example='https://xxx'),
      createdAt?: string(name='createdAt', example='2022-02-18 14:24:54'),
      description?: string(name='description'),
      id?: long(name='id', example='29322'),
      name?: string(name='name', example='codeup'),
      ownerId?: long(name='ownerId', example='19238'),
      path?: string(name='path'),
      updatedAt?: string(name='updatedAt', example='2022-03-18 14:24:54'),
      visibilityLevel?: int32(name='visibilityLevel', example='0'),
    }(name='namespace'),
    path?: string(name='path', example='codeup'),
    pathWithNamespace?: string(name='pathWithNamespace', example='codeup-test-org / codeup'),
    snippetsEnabled?: boolean(name='snippetsEnabled', example='false'),
    sshUrlToRepo?: string(name='sshUrlToRepo', example='git@codeup.aliyun.com:xxx/test/test.git'),
    visibilityLevel?: int32(name='visibilityLevel', example='0'),
    webUrl?: string(name='webUrl', example='https://codeup.aliyun.com/xxx/test/test'),
    wikiEnabled?: boolean(name='wikiEnabled', example='true'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model UpdateRepositoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateRepositoryResponseBody(name='body'),
}

/**
 * @summary 更新代码库名称、路径、描述、默认分支等设置
 *
 * @param request UpdateRepositoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateRepositoryResponse
 */
async function updateRepositoryWithOptions(repositoryId: string, request: UpdateRepositoryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateRepositoryResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.adminSettingLanguage)) {
    body['adminSettingLanguage'] = request.adminSettingLanguage;
  }
  if (!Util.isUnset(request.avatar)) {
    body['avatar'] = request.avatar;
  }
  if (!Util.isUnset(request.buildsEnabled)) {
    body['buildsEnabled'] = request.buildsEnabled;
  }
  if (!Util.isUnset(request.checkEmail)) {
    body['checkEmail'] = request.checkEmail;
  }
  if (!Util.isUnset(request.defaultBranch)) {
    body['defaultBranch'] = request.defaultBranch;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.id)) {
    body['id'] = request.id;
  }
  if (!Util.isUnset(request.issuesEnabled)) {
    body['issuesEnabled'] = request.issuesEnabled;
  }
  if (!Util.isUnset(request.mergeRequestsEnabled)) {
    body['mergeRequestsEnabled'] = request.mergeRequestsEnabled;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.openCloneDownloadControl)) {
    body['openCloneDownloadControl'] = request.openCloneDownloadControl;
  }
  if (!Util.isUnset(request.path)) {
    body['path'] = request.path;
  }
  if (!Util.isUnset(request.projectCloneDownloadMethodList)) {
    body['projectCloneDownloadMethodList'] = request.projectCloneDownloadMethodList;
  }
  if (!Util.isUnset(request.projectCloneDownloadRoleList)) {
    body['projectCloneDownloadRoleList'] = request.projectCloneDownloadRoleList;
  }
  if (!Util.isUnset(request.snippetsEnabled)) {
    body['snippetsEnabled'] = request.snippetsEnabled;
  }
  if (!Util.isUnset(request.visibilityLevel)) {
    body['visibilityLevel'] = request.visibilityLevel;
  }
  if (!Util.isUnset(request.wikiEnabled)) {
    body['wikiEnabled'] = request.wikiEnabled;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateRepository',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新代码库名称、路径、描述、默认分支等设置
 *
 * @param request UpdateRepositoryRequest
 * @return UpdateRepositoryResponse
 */
async function updateRepository(repositoryId: string, request: UpdateRepositoryRequest): UpdateRepositoryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateRepositoryWithOptions(repositoryId, request, headers, runtime);
}

model UpdateRepositoryMemberRequest {
  accessToken?: string(name='accessToken', example='f0b1e61db5961df5975a93f9129d2513'),
  accessLevel?: int32(name='accessLevel', example='30'),
  expireAt?: string(name='expireAt', example='2020-08-08 08:08:08'),
  memberType?: string(name='memberType', example='USERS'),
  relatedId?: string(name='relatedId', example='10010'),
  relatedInfos?: [ 
    {
      relatedId?: string(name='relatedId', example='10011'),
      sourceId?: long(name='sourceId', example='24790'),
      sourceType?: string(name='sourceType', example='Project'),
    }
  ](name='relatedInfos'),
  organizationId?: string(name='organizationId', description='This parameter is required.', example='60de7a6852743a5162b5f957'),
}

model UpdateRepositoryMemberResponseBody = {
  errorCode?: string(name='errorCode', example='success'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='F590C9D8-E908-5B6C-95AC-56B7E8011FFA'),
  result?: {
    accessLevel?: int32(name='accessLevel', example='40'),
    avatarUrl?: string(name='avatarUrl', example='https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100'),
    email?: string(name='email', example='test@alibaba.com'),
    expireAt?: string(name='expireAt', example='2020-08-08 08:08:08'),
    id?: long(name='id', example='30815'),
    memberName?: string(name='memberName', example='test_memeber_name'),
    memberType?: string(name='memberType', example='USERS'),
    name?: string(name='name', example='codeup'),
    sourceId?: long(name='sourceId', example='223241'),
    sourceType?: string(name='sourceType', example='Project'),
    state?: string(name='state', example='normal'),
    username?: string(name='username', example='codeup-test'),
    webUrl?: string(name='webUrl', description='web url', example='""'),
  }(name='result'),
  success?: boolean(name='success', example='true'),
}

model UpdateRepositoryMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateRepositoryMemberResponseBody(name='body'),
}

/**
 * @summary 修改代码库成员的权限（角色）
 *
 * @param request UpdateRepositoryMemberRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateRepositoryMemberResponse
 */
async function updateRepositoryMemberWithOptions(repositoryId: string, aliyunPk: string, request: UpdateRepositoryMemberRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateRepositoryMemberResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessToken)) {
    query['accessToken'] = request.accessToken;
  }
  if (!Util.isUnset(request.organizationId)) {
    query['organizationId'] = request.organizationId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.accessLevel)) {
    body['accessLevel'] = request.accessLevel;
  }
  if (!Util.isUnset(request.expireAt)) {
    body['expireAt'] = request.expireAt;
  }
  if (!Util.isUnset(request.memberType)) {
    body['memberType'] = request.memberType;
  }
  if (!Util.isUnset(request.relatedId)) {
    body['relatedId'] = request.relatedId;
  }
  if (!Util.isUnset(request.relatedInfos)) {
    body['relatedInfos'] = request.relatedInfos;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateRepositoryMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/repository/${OpenApiUtil.getEncodeParam(repositoryId)}/members/${OpenApiUtil.getEncodeParam(aliyunPk)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改代码库成员的权限（角色）
 *
 * @param request UpdateRepositoryMemberRequest
 * @return UpdateRepositoryMemberResponse
 */
async function updateRepositoryMember(repositoryId: string, aliyunPk: string, request: UpdateRepositoryMemberRequest): UpdateRepositoryMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateRepositoryMemberWithOptions(repositoryId, aliyunPk, request, headers, runtime);
}

model UpdateResourceMemberRequest {
  roleName?: string(name='roleName', description='This parameter is required.', example='admin'),
}

model UpdateResourceMemberResponseBody = {
  errorCode?: string(name='errorCode', example='""'),
  errorMessage?: string(name='errorMessage', example='""'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model UpdateResourceMemberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateResourceMemberResponseBody(name='body'),
}

/**
 * @summary 更新资源成员
 *
 * @param request UpdateResourceMemberRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateResourceMemberResponse
 */
async function updateResourceMemberWithOptions(organizationId: string, resourceType: string, resourceId: string, accountId: string, request: UpdateResourceMemberRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateResourceMemberResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.roleName)) {
    body['roleName'] = request.roleName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateResourceMember',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/${OpenApiUtil.getEncodeParam(resourceType)}/${OpenApiUtil.getEncodeParam(resourceId)}/members/${OpenApiUtil.getEncodeParam(accountId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新资源成员
 *
 * @param request UpdateResourceMemberRequest
 * @return UpdateResourceMemberResponse
 */
async function updateResourceMember(organizationId: string, resourceType: string, resourceId: string, accountId: string, request: UpdateResourceMemberRequest): UpdateResourceMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateResourceMemberWithOptions(organizationId, resourceType, resourceId, accountId, request, headers, runtime);
}

model UpdateTestCaseRequest {
  updateWorkitemPropertyRequest?: [ 
    {
      fieldIdentifier?: string(name='fieldIdentifier', description='This parameter is required.', example='tc.type'),
      fieldValue?: string(name='fieldValue', description='This parameter is required.', example='0a032xx28107xxxx53e87a9'),
    }
  ](name='updateWorkitemPropertyRequest', description='This parameter is required.'),
}

model UpdateTestCaseResponseBody = {
  testcase?: {
    assignedTo?: {
      assignIdentifier?: string(name='assignIdentifier', example='1316xxxxxx8624xxx'),
      name?: string(name='name'),
      tbRoleId?: string(name='tbRoleId', example='xxxxxxxewdds12xxx'),
    }(name='assignedTo'),
    categoryIdentifier?: string(name='categoryIdentifier', example='TestCase'),
    creator?: {
      createIdentifier?: string(name='createIdentifier', example='1316xxxxxx8624xxx'),
      name?: string(name='name', example='xxxxxxx'),
    }(name='creator'),
    detailInfo?: {
      expectedResult?: {
        expectContent?: string(name='expectContent'),
        expectContentType?: string(name='expectContentType', example='MARKDOWN'),
        expectIdentifier?: string(name='expectIdentifier', example='685340d13127b01185335bd360'),
      }(name='expectedResult'),
      precondition?: {
        preContent?: string(name='preContent'),
        preContentType?: string(name='preContentType', example='MARKDOWN'),
        preIdentifier?: string(name='preIdentifier', example='3354596c7b3004480b635acf95'),
      }(name='precondition'),
      stepContent?: {
        stepContent?: string(name='stepContent'),
        stepContentType?: string(name='stepContentType', example='RICHTEXT'),
        stepIdentifier?: string(name='stepIdentifier', example='ad504e6cdcd2165b28eb1e1b9f'),
      }(name='stepContent'),
      stepType?: string(name='stepType', example='TEXT/TABLE'),
    }(name='detailInfo'),
    directory?: {
      childIdentifier?: string(name='childIdentifier', example='2973f597c14c6f533fffdcd05c'),
      directoryIdentifier?: string(name='directoryIdentifier', example='e27b8eace6501ce51cf5d56784'),
      name?: string(name='name'),
      pathName?: [ string ](name='pathName'),
    }(name='directory'),
    identifier?: string(name='identifier', example='c7f7033b021ead52cc42721382'),
    modifier?: {
      modifyIdentifier?: string(name='modifyIdentifier', example='1316xxxxxx8624xxx'),
      name?: string(name='name', example='xxxxxxx'),
    }(name='modifier'),
    spaceIdentifier?: string(name='spaceIdentifier', example='1e7d7a412b91a2144ec4aa8411'),
    spaceType?: string(name='spaceType', example='TestRepo'),
    subject?: string(name='subject'),
  }(name='Testcase'),
  errorCode?: string(name='errorCode', example='""'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', description='Id of the request', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model UpdateTestCaseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTestCaseResponseBody(name='body'),
}

/**
 * @summary 更新测试用例字段
 *
 * @param request UpdateTestCaseRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTestCaseResponse
 */
async function updateTestCaseWithOptions(organizationId: string, testcaseIdentifier: string, request: UpdateTestCaseRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateTestCaseResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.updateWorkitemPropertyRequest)) {
    body['updateWorkitemPropertyRequest'] = request.updateWorkitemPropertyRequest;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateTestCase',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/testhub/testcase/${OpenApiUtil.getEncodeParam(testcaseIdentifier)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新测试用例字段
 *
 * @param request UpdateTestCaseRequest
 * @return UpdateTestCaseResponse
 */
async function updateTestCase(organizationId: string, testcaseIdentifier: string, request: UpdateTestCaseRequest): UpdateTestCaseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateTestCaseWithOptions(organizationId, testcaseIdentifier, request, headers, runtime);
}

model UpdateTestResultRequest {
  executor?: string(name='executor', example='131xxx38624xxxx68'),
  status?: string(name='status', example='TO DO'),
}

model UpdateTestResultResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model UpdateTestResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTestResultResponseBody(name='body'),
}

/**
 * @summary 更新了测试计划中测试用例的执行人与状态
 *
 * @param request UpdateTestResultRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTestResultResponse
 */
async function updateTestResultWithOptions(organizationId: string, testPlanIdentifier: string, testcaseIdentifier: string, request: UpdateTestResultRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateTestResultResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.executor)) {
    body['executor'] = request.executor;
  }
  if (!Util.isUnset(request.status)) {
    body['status'] = request.status;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateTestResult',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/testhub/testplan/${OpenApiUtil.getEncodeParam(testPlanIdentifier)}/testresult/${OpenApiUtil.getEncodeParam(testcaseIdentifier)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新了测试计划中测试用例的执行人与状态
 *
 * @param request UpdateTestResultRequest
 * @return UpdateTestResultResponse
 */
async function updateTestResult(organizationId: string, testPlanIdentifier: string, testcaseIdentifier: string, request: UpdateTestResultRequest): UpdateTestResultResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateTestResultWithOptions(organizationId, testPlanIdentifier, testcaseIdentifier, request, headers, runtime);
}

model UpdateVariableGroupRequest {
  description?: string(name='description', example='变量组'),
  name?: string(name='name', description='This parameter is required.', example='变量组'),
  variables?: string(name='variables', description='This parameter is required.', example='[{"isEncrypted":true,"name":"name1","value":"vaue1"}]'),
}

model UpdateVariableGroupResponseBody = {
  errorCode?: string(name='errorCode', example='”“'),
  errorMessage?: string(name='errorMessage', example='”“'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
}

model UpdateVariableGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateVariableGroupResponseBody(name='body'),
}

/**
 * @summary 更新变量组
 *
 * @param request UpdateVariableGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateVariableGroupResponse
 */
async function updateVariableGroupWithOptions(organizationId: string, id: string, request: UpdateVariableGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateVariableGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.variables)) {
    body['variables'] = request.variables;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateVariableGroup',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/variableGroups/${OpenApiUtil.getEncodeParam(id)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新变量组
 *
 * @param request UpdateVariableGroupRequest
 * @return UpdateVariableGroupResponse
 */
async function updateVariableGroup(organizationId: string, id: string, request: UpdateVariableGroupRequest): UpdateVariableGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateVariableGroupWithOptions(organizationId, id, request, headers, runtime);
}

model UpdateWorkItemRequest {
  fieldType?: string(name='fieldType', description='This parameter is required.', example='subject'),
  identifier?: string(name='identifier', description='This parameter is required.', example='e8b2xxxxxx2abdxxxxxxxx23'),
  propertyKey?: string(name='propertyKey', description='This parameter is required.', example='subject'),
  propertyValue?: string(name='propertyValue', description='This parameter is required.', example='newValue'),
}

model UpdateWorkItemResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMessage?: string(name='errorMessage', example='error'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  workitem?: {
    assignedTo?: string(name='assignedTo', example='19xx7043xxxxxxx914'),
    categoryIdentifier?: string(name='categoryIdentifier', example='Req'),
    creator?: string(name='creator', example='19xx7043xxxxxxx914'),
    document?: string(name='document', example='html格式'),
    documentFormat?: string(name='documentFormat'),
    gmtCreate?: long(name='gmtCreate', example='1640850318000'),
    gmtModified?: long(name='gmtModified', example='1640850318000'),
    identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
    logicalStatus?: string(name='logicalStatus', example='NORMAL'),
    modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
    parentIdentifier?: string(name='parentIdentifier', example='e8bxxxxxxxxxxxxxxxx24'),
    serialNumber?: string(name='serialNumber', example='ACFS-1'),
    spaceIdentifier?: string(name='spaceIdentifier', example='e8b26xxxxx6e76aa20xxxxx23'),
    spaceName?: string(name='spaceName', example='需求项目'),
    spaceType?: string(name='spaceType', example='Project'),
    sprintIdentifier?: string(name='sprintIdentifier', example='75528f17703e92e5a568......'),
    status?: string(name='status', example='待处理'),
    statusIdentifier?: string(name='statusIdentifier', example='111000'),
    statusStageIdentifier?: string(name='statusStageIdentifier', example='1'),
    subject?: string(name='subject', example='测试工作项'),
    updateStatusAt?: long(name='updateStatusAt', example='1640850328000'),
    workitemTypeIdentifier?: string(name='workitemTypeIdentifier', example='9uxxxxxxre573f5xxxxxx0'),
  }(name='workitem'),
}

model UpdateWorkItemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateWorkItemResponseBody(name='body'),
}

/**
 * @summary 更新工作项信息
 *
 * @param request UpdateWorkItemRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateWorkItemResponse
 */
async function updateWorkItemWithOptions(organizationId: string, request: UpdateWorkItemRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateWorkItemResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.fieldType)) {
    body['fieldType'] = request.fieldType;
  }
  if (!Util.isUnset(request.identifier)) {
    body['identifier'] = request.identifier;
  }
  if (!Util.isUnset(request.propertyKey)) {
    body['propertyKey'] = request.propertyKey;
  }
  if (!Util.isUnset(request.propertyValue)) {
    body['propertyValue'] = request.propertyValue;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateWorkItem',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新工作项信息
 *
 * @param request UpdateWorkItemRequest
 * @return UpdateWorkItemResponse
 */
async function updateWorkItem(organizationId: string, request: UpdateWorkItemRequest): UpdateWorkItemResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateWorkItemWithOptions(organizationId, request, headers, runtime);
}

model UpdateWorkitemCommentRequest {
  commentId?: long(name='commentId', description='This parameter is required.', example='1964584'),
  content?: string(name='content', description='This parameter is required.'),
  formatType?: string(name='formatType', description='This parameter is required.', example='MARKDOWN/RICHTEXT'),
  workitemIdentifier?: string(name='workitemIdentifier', description='This parameter is required.', example='9144ef6b72d8exxxxx9e61a4d0'),
}

model UpdateWorkitemCommentResponseBody = {
  comment?: {
    content?: string(name='content'),
    createTime?: long(name='createTime', example='1667205617061'),
    formatType?: string(name='formatType', example='MARKDOWN/RICHTEXT'),
    id?: string(name='id', example='1964584'),
    isTop?: boolean(name='isTop', example='true/false'),
    modifiedTime?: long(name='modifiedTime', example='1646323200000'),
    parentId?: long(name='parentId', example='2684432'),
    targetIdentifier?: string(name='targetIdentifier', example='deafe5f33xxxxx6a259d8dafd'),
    targetType?: string(name='targetType', example='workitem'),
    topTime?: long(name='topTime', example='1667205617089'),
    user?: {
      account?: string(name='account', example='1316458xxxxx41068'),
      avatar?: string(name='avatar', example='https://tcs-devops.aliyuncs.com/thumbnail/112m7150e256dbba0d6456bafbb65c81f90d/w/200/h/200'),
      displayName?: string(name='displayName'),
      identifier?: string(name='identifier', example='9144ef6b72d8exxxxx9e61a4d0'),
      nickName?: string(name='nickName'),
      realName?: string(name='realName'),
    }(name='user'),
  }(name='comment'),
  errorCode?: string(name='errorCode', example='InvalidParam.NotFound'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', description='Id of the request', example='F7B85D1B-D1C2-140F-A039-341859F130B9'),
  success?: string(name='success', example='true'),
}

model UpdateWorkitemCommentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateWorkitemCommentResponseBody(name='body'),
}

/**
 * @summary 更新工作项评论
 *
 * @param request UpdateWorkitemCommentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateWorkitemCommentResponse
 */
async function updateWorkitemCommentWithOptions(organizationId: string, request: UpdateWorkitemCommentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateWorkitemCommentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.commentId)) {
    body['commentId'] = request.commentId;
  }
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.formatType)) {
    body['formatType'] = request.formatType;
  }
  if (!Util.isUnset(request.workitemIdentifier)) {
    body['workitemIdentifier'] = request.workitemIdentifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateWorkitemComment',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/commentUpdate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新工作项评论
 *
 * @param request UpdateWorkitemCommentRequest
 * @return UpdateWorkitemCommentResponse
 */
async function updateWorkitemComment(organizationId: string, request: UpdateWorkitemCommentRequest): UpdateWorkitemCommentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateWorkitemCommentWithOptions(organizationId, request, headers, runtime);
}

model UpdateWorkitemFieldRequest {
  updateWorkitemPropertyRequest?: [ 
    {
      fieldIdentifier?: string(name='fieldIdentifier', description='This parameter is required.', example='tag'),
      fieldValue?: string(name='fieldValue', description='This parameter is required.'),
    }
  ](name='updateWorkitemPropertyRequest', description='This parameter is required.'),
  workitemIdentifier?: string(name='workitemIdentifier', description='This parameter is required.', example='9144ef6b72d8exxxxx9e61a4d0'),
}

model UpdateWorkitemFieldResponseBody = {
  errorCode?: string(name='errorCode', example='Openapi.RequestError'),
  errorMsg?: string(name='errorMsg', example='error'),
  requestId?: string(name='requestId', example='ASSDS-ASSASX-XSAXSA-XSAXSAXS'),
  success?: boolean(name='success', example='true'),
  workitem?: {
    assignedTo?: string(name='assignedTo', example='19xx7043xxxxxxx914'),
    categoryIdentifier?: string(name='categoryIdentifier', example='Req'),
    creator?: string(name='creator', example='19xx7043xxxxxxx914'),
    document?: string(name='document', example='html格式'),
    gmtCreate?: long(name='gmtCreate', example='1640850318000'),
    gmtModified?: long(name='gmtModified', example='1640850318000'),
    identifier?: string(name='identifier', example='e8bxxxxxxxxxxxxxxxx23'),
    logicalStatus?: string(name='logicalStatus', example='NORMAL'),
    modifier?: string(name='modifier', example='19xx7043xxxxxxx914'),
    parentIdentifier?: string(name='parentIdentifier', example='e8bxxxxxxxxxxxxxxxx24'),
    serialNumber?: string(name='serialNumber', example='1'),
    spaceIdentifier?: string(name='spaceIdentifier', example='e8b26xxxxx6e76aa20xxxxx23'),
    spaceName?: string(name='spaceName', example='需求项目'),
    spaceType?: string(name='spaceType', example='Project'),
    sprintIdentifier?: string(name='sprintIdentifier', example='75528f17703e92e5a568......'),
    status?: string(name='status', example='待处理'),
    statusIdentifier?: string(name='statusIdentifier', example='28'),
    statusStageIdentifier?: string(name='statusStageIdentifier', example='1'),
    subject?: string(name='subject', example='测试工作项'),
    updateStatusAt?: long(name='updateStatusAt', example='1640850328000'),
    workitemTypeIdentifier?: string(name='workitemTypeIdentifier', example='9uxxxxxxre573f5xxxxxx0'),
  }(name='workitem'),
}

model UpdateWorkitemFieldResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateWorkitemFieldResponseBody(name='body'),
}

/**
 * @summary 批量更新工作项字段信息
 *
 * @param request UpdateWorkitemFieldRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateWorkitemFieldResponse
 */
async function updateWorkitemFieldWithOptions(organizationId: string, request: UpdateWorkitemFieldRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateWorkitemFieldResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.updateWorkitemPropertyRequest)) {
    body['updateWorkitemPropertyRequest'] = request.updateWorkitemPropertyRequest;
  }
  if (!Util.isUnset(request.workitemIdentifier)) {
    body['workitemIdentifier'] = request.workitemIdentifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateWorkitemField',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitems/updateWorkitemField`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 批量更新工作项字段信息
 *
 * @param request UpdateWorkitemFieldRequest
 * @return UpdateWorkitemFieldResponse
 */
async function updateWorkitemField(organizationId: string, request: UpdateWorkitemFieldRequest): UpdateWorkitemFieldResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateWorkitemFieldWithOptions(organizationId, request, headers, runtime);
}

model WorkitemAttachmentCreateRequest {
  fileKey?: string(name='fileKey', description='This parameter is required.', example='1106473328927498/1106473328927498/5ec071g0e5ij85fche8cddchje.xlsx'),
  originalFilename?: string(name='originalFilename', description='This parameter is required.', example='xxx.tgz'),
}

model WorkitemAttachmentCreateResponseBody = {
  errorCode?: string(name='errorCode', example='SYSTEM_UNKNOWN_ERROR'),
  errorMessage?: string(name='errorMessage', example='InvalidTagGroup.IdNotFoundntraceId: 2137844496.4337.16624448853053831'),
  requestId?: string(name='requestId', example='F590C9D8-E908-5B6C-95AC-56B7E8011FFA'),
  success?: string(name='success', example='true'),
}

model WorkitemAttachmentCreateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WorkitemAttachmentCreateResponseBody(name='body'),
}

/**
 * @summary 工作项附件创建
 *
 * @param request WorkitemAttachmentCreateRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return WorkitemAttachmentCreateResponse
 */
async function workitemAttachmentCreateWithOptions(organizationId: string, workitemIdentifier: string, request: WorkitemAttachmentCreateRequest, headers: map[string]string, runtime: Util.RuntimeOptions): WorkitemAttachmentCreateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.fileKey)) {
    body['fileKey'] = request.fileKey;
  }
  if (!Util.isUnset(request.originalFilename)) {
    body['originalFilename'] = request.originalFilename;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'WorkitemAttachmentCreate',
    version = '2021-06-25',
    protocol = 'HTTPS',
    pathname = `/organization/${OpenApiUtil.getEncodeParam(organizationId)}/workitem/${OpenApiUtil.getEncodeParam(workitemIdentifier)}/attachment`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 工作项附件创建
 *
 * @param request WorkitemAttachmentCreateRequest
 * @return WorkitemAttachmentCreateResponse
 */
async function workitemAttachmentCreate(organizationId: string, workitemIdentifier: string, request: WorkitemAttachmentCreateRequest): WorkitemAttachmentCreateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return workitemAttachmentCreateWithOptions(organizationId, workitemIdentifier, request, headers, runtime);
}

